回复 1# 9922250
楼主请查看用户自定义函数的帮助吧,里面有:
Function Reference
_SendMessage
--------------------------------------------------------------------------------
Wrapper for commonly used Dll Call
#Include <SendMessage.au3>
_SendMessage($hWnd, $iMsg [, $wParam = 0 [, $lParam = 0 [, $iReturn = 0 [, $wParamType = "wparam" [, $lParamType = "lparam" [, $sReturnType = "lparam"]]]]]])
Parameters
$hWnd Window/control handle
$iMsg Message to send to control (number)
$wParam [optional] Specifies additional message-specific information
$lParam [optional] Specifies additional message-specific information
$iReturn [optional] What to return:
0 - Return value from dll call
1 - $ihWnd
2 - $iMsg
3 - $wParam
4 - $lParam
<0 or > 4 - array same as dllcall
$wParamType [optional] See DllCall in Related
$lParamType [optional] See DllCall in Related
$sReturnType [optional] See DllCall in Related
Return Value
Success: User selected value from the DllCall() result
Failure: @error is set
Remarks
None.
Related
_SendMessageA, DllCall
Example
#include <SendMessage.au3>
_Main()
Func _Main()
Local Const $Off = 2, $On = -1
Opt("WinTitleMatchMode", 4)
Local $hwnd = WinGetHandle('classname=Progman')
_ToggleMonitor($hwnd, $Off)
Sleep(3000)
_ToggleMonitor($hwnd, $On)
EndFunc ;==>_Main
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 ;==>_ToggleMonitor |