Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Visual Basic 6 - Come creare uno screen saver
Forum - Visual Basic 6 - Come creare uno screen saver

Avatar
XBarboX (Member)
Guru


Messaggi: 945
Iscritto: 31/12/2008

Segnala al moderatore
Postato alle 15:16
Domenica, 24/01/2010
Salve,
devo creare uno screen saver in visual basic.
Ho seguito molte guide come questa (http://support.microsoft.com/kb/106239) ma non funziona!
Ecco il mio problema:
ho creato una ventina di screen saver, tutti funzionanti(se cliccavo su prova andava, se su impostazioni apriva la corretta finestra...) mentre se lasciavo in inattività il pc saltava fuori tutt'altro che il mio screen saver: http://www.pierotofy.it/pages/extra...mp;attachment=0
Notare la mini-finestra in basso a sinistra...
Come mai il mio screen saver appare così e non come quando clicco su prova?

Allego il codice:
Codice sorgente - presumibilmente VB.NET

  1. Private Declare Function SetWindowPos Lib "user32" _
  2.         (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
  3.         ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _
  4.         ByVal cy As Long, ByVal wFlags As Long) As Long
  5.  
  6. Private Declare Function ShowCursor Lib "user32" _
  7.         (ByVal bShow As Long) As Long
  8.        
  9.         Sub AlwaysOnTop(FrmID As Form, OnTop As Boolean)
  10.    Const SWP_NOMOVE = 2
  11.    Const SWP_NOSIZE = 1
  12.    Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  13.    Const HWND_TOPMOST = -1
  14.    Const HWND_NOTOPMOST = -2
  15.  
  16.    If OnTop Then
  17.       OnTop = SetWindowPos(FrmID.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  18.    Else
  19.       OnTop = SetWindowPos(FrmID.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  20.    End If
  21. End Sub
  22.  
  23.  
  24.  
  25. Private Sub Form_Click()
  26. Static Count As Integer
  27. Count = Count + 1
  28. If Count > 5 Then
  29.    Unload Me
  30. End If
  31. End Sub
  32.  
  33. Private Sub Form_KeyPress(KeyAscii As Integer)
  34. Static Count As Integer
  35. Count = Count + 1
  36. If Count > 5 Then
  37.    Unload Me
  38. End If
  39. End Sub
  40.  
  41. Private Sub Form_Load()
  42. Select Case LCase(Left(Command, 2))
  43.     Case "/p": End
  44.     Case "/s"
  45.     Case Else: Me.Hide: frmSettings.Show: Exit Sub
  46. End Select
  47.  
  48. Dim X As Integer
  49. Call AlwaysOnTop(Me, True)
  50. X = ShowCursor(False)
  51. End Sub
  52.  
  53. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  54. Static Count As Integer
  55. Count = Count + 1
  56. If Count > 5 Then
  57.    Unload Me
  58. End If
  59.  
  60.  
  61. End Sub
  62.  
  63. Private Sub Form_Unload(Cancel As Integer)
  64. Dim X As Integer
  65. X = ShowCursor(True)
  66. End Sub


PM Quote
Avatar
XBarboX (Member)
Guru


Messaggi: 945
Iscritto: 31/12/2008

Segnala al moderatore
Postato alle 15:40
Domenica, 24/01/2010
ecco l'immagine:


XBarboX ha allegato un file: Immagine.jpg (125028 bytes)
Clicca qui per guardare l'immagine
PM Quote
Avatar
Alfonso (Ex-Member)
Guru


Messaggi: 688
Iscritto: 30/09/2009

Segnala al moderatore
Postato alle 16:13
Domenica, 24/01/2010
Ma hai settato windowsState=maximize ?

Ultima modifica effettuata da Alfonso il 24/01/2010 alle 16:14
PM Quote
Avatar
XBarboX (Member)
Guru


Messaggi: 945
Iscritto: 31/12/2008

Segnala al moderatore
Postato alle 17:59
Domenica, 24/01/2010
Testo quotato

Postato originariamente da Alfonso:

Ma hai settato windowsState=maximize ?



Ho dimenticato di scrivere che ho risolto. Infatti l'errore è proprio quello XD

PM Quote