Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Possibly Related Threads…
Thread Author Replies Views Last Post
Star Suggestion for new REPLACE$() function zaadstra 3 264 01-26-2026, 05:11 PM
Last Post: grymmjack
  Is there a menu function? Mad Axeman 17 1,125 12-17-2025, 04:43 AM
Last Post: SMcNeill
  error on function returning _mem Herve 5 698 07-05-2025, 08:06 PM
Last Post: hsiangch_ong
Question Can a function return a custom TYPE? 12centuries 3 1,330 06-13-2024, 09:19 PM
Last Post: 12centuries
  SUB & FUNCTION when declaring dynamic library TerryRitchie 9 1,783 06-11-2024, 11:28 AM
Last Post: SpriggsySpriggs

Forum Jump:


Users browsing this thread: 2 Guest(s)