brianod
Jan 22nd, 2000, 04:17 AM
Hi, I really need code that can start the default screensaver in both windows 95 and 98. but so far all the code i found starts the screensaver in win95 but activates the suspend mode in win98! does anybody have any idea on how i can accomplish starting the default screensaver in both versions of windows? maybe i could access the registry to find the default screensaver or something... any ideas are much needed! thanks in advance
Clunietp
Jan 22nd, 2000, 04:24 AM
Works fine for me under Win98:
Private Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Const WM_SYSCOMMAND = &H112&
Const SC_SCREENSAVE = &HF140&
Public Sub ActivateScreenSaver()
Dim ret As Long 'junk return value
Dim desktop As Long 'desktop handle
desktop = GetDesktopWindow
ret = SendMessage(desktop, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)
End Sub