[fpc-pascal] Windows API SendMessage()

James Richters james at productionautomation.net
Fri Aug 11 12:15:04 CEST 2017


>I have found this:
>
>https://stackoverflow.com/questions/25011141/turn-off-on-monitor-cant-turn-on
>
>It's in c++, but it looks that since w.8, you must simulate a mouse move.

Thanks for the info.  It got me on the right track.  It seems to depend on which method is used to simulate mouse or keyboard.
Here is what I found out:
Moving the mouse with SetCursorPos(x,y);   does not wake up the display
Moving the mouse with   Mouse_Event(MouseEventF_Move,100,100,0,0);     does wake up the display
Simulating the Keyboard with PostMessage(progname, WM_KEYDOWN, VK_F5, 0);  does not wake the display
Simulating the Keyboard with Keybd_Event(VK_Shift,1,0,0);  does wake up the display

James






More information about the fpc-pascal mailing list