MerkurAlex Posted February 1, 2008 Posted February 1, 2008 Im looking for a few examples on how to use this function also im wondering will this allow to send key presses to a window? [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]
seandisanti Posted February 1, 2008 Posted February 1, 2008 (edited) Im looking for a few examples on how to use this function also im wondering will this allow to send key presses to a window? #include <misc.au3> _Main() Func _Main() Local Const $Off = 2, $On = -1 Opt("WinTitleMatchMode", 4) $hwnd = WinGetHandle('classname=Progman') _ToggleMonitor($hWnd, $Off) Sleep ( 3000 ) _ToggleMonitor($hWnd, $On) EndFunc Func _ToggleMonitor($hwnd, $OnOff) Local Const $WM_SYSCOMMAND = 274 Local Const $SC_MONITORPOWER = 61808 _SendMessage($hWnd, $WM_SYSCOMMAND, $SC_MONITORPOWER, $OnOff) If @error Then MsgBox(0,"_ToggleMonitor", "_SendMessage Error: " & @error) Exit EndIf EndFunc Why use _SendMessage() to send keystrokes instead of send(),controlsend() or dll call? Edited February 1, 2008 by cameronsdad
MerkurAlex Posted February 1, 2008 Author Posted February 1, 2008 Why use _SendMessage() to send keystrokes instead of send(),controlsend() or dll call?Well because it would send it directly to the window...How would you use a dll call for sending keys? [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now