9922250 发表于 2012-6-20 12:03:45

_SendMessage 想查这个函数的 参数,帮助文本没有,去那里查

_SendMessage

想查这个函数的 参数,帮助文本没有,去那里查


Const $WM_RBUTTONDOWN = 0x204;右键按下
_SendMessage($Data,0x0201,0,0);点击指定控件

benkel 发表于 2012-6-20 12:38:32

MSDN:http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx
这个具体要看你发给什么的,各个控件都不太一样!比如列表查看器的:http://msdn.microsoft.com/en-us/library/windows/desktop/ff485961(v=vs.85).aspx

xms77 发表于 2012-6-21 12:31:11

回复 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 Specifies additional message-specific information
$lParam Specifies additional message-specific information
$iReturn 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 See DllCall in Related
$lParamType See DllCall in Related
$sReturnType 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
页: [1]
查看完整版本: _SendMessage 想查这个函数的 参数,帮助文本没有,去那里查