Screen Saver Function Call
#4
The GetDesktopWindow works flawlessly for me in Win11.

Code: (Select All)
' declare external libraries.
Declare Dynamic Library "user32"
    Function SendMessageA%& (ByVal hWnd%&, Byval Msg~&, Byval wParam~%&, Byval lParam%&)
    Function GetDesktopWindow%& ()
End Declare

' declare screen saver call constants
Const wm_syscommand = &H112&
Const sc_screensave = &HF140&
Sleep 2

Print GetDesktopWindow
Print &HFFFF&
Sleep

s%& = SendMessageA(GetDesktopWindow, wm_syscommand, sc_screensave, 0&)



[Image: image.png]

As you can see from the tiny little screenshot above, the value I get from GetDesktopWindow isn't the same as the &HFFFF which you were using.  That could be the whole issue in a nutshell.
Reply


Messages In This Thread
Screen Saver Function Call - by eoredson - 12-16-2022, 06:11 AM
RE: Screen Saver Function Call - by SMcNeill - 12-16-2022, 06:52 AM
RE: Screen Saver Function Call - by SMcNeill - 12-16-2022, 06:59 AM
RE: Screen Saver Function Call - by SMcNeill - 12-16-2022, 02:54 PM
RE: Screen Saver Function Call - by eoredson - 12-16-2022, 11:54 PM
RE: Screen Saver Function Call - by eoredson - 12-17-2022, 12:37 AM
RE: Screen Saver Function Call - by SMcNeill - 12-17-2022, 12:46 AM
RE: Screen Saver Function Call - by eoredson - 12-17-2022, 01:38 AM
RE: Screen Saver Function Call - by Pete - 12-17-2022, 01:33 AM
RE: Screen Saver Function Call - by Pete - 12-17-2022, 05:01 AM
RE: Screen Saver Function Call - by eoredson - 01-02-2023, 04:55 AM



Users browsing this thread: 3 Guest(s)