24/01/10 14:16
XBarboX
Salve,
devo creare uno screen saver in visual basic.
Ho seguito molte guide come questa (support.microsoft.com/kb/…) 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: pierotofy.it/pages/…
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:
devo creare uno screen saver in visual basic.
Ho seguito molte guide come questa (support.microsoft.com/kb/…) 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: pierotofy.it/pages/…
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:
Private Declare Function SetWindowPos Lib "user32" _ (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _ ByVal X As Long, ByVal Y As Long, ByVal cx As Long, _ ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function ShowCursor Lib "user32" _ (ByVal bShow As Long) As Long Sub AlwaysOnTop(FrmID As Form, OnTop As Boolean) Const SWP_NOMOVE = 2 Const SWP_NOSIZE = 1 Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE Const HWND_TOPMOST = -1 Const HWND_NOTOPMOST = -2 If OnTop Then OnTop = SetWindowPos(FrmID.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS) Else OnTop = SetWindowPos(FrmID.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS) End If End Sub Private Sub Form_Click() Static Count As Integer Count = Count + 1 If Count > 5 Then Unload Me End If End Sub Private Sub Form_KeyPress(KeyAscii As Integer) Static Count As Integer Count = Count + 1 If Count > 5 Then Unload Me End If End Sub Private Sub Form_Load() Select Case LCase(Left(Command, 2)) Case "/p": End Case "/s" Case Else: Me.Hide: frmSettings.Show: Exit Sub End Select Dim X As Integer Call AlwaysOnTop(Me, True) X = ShowCursor(False) End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Static Count As Integer Count = Count + 1 If Count > 5 Then Unload Me End If End Sub Private Sub Form_Unload(Cancel As Integer) Dim X As Integer X = ShowCursor(True) End Sub
aaa