找回密码
 加入
搜索
查看: 1659|回复: 2

[AU3基础] _SendMessage 想查这个函数的 参数,帮助文本没有,去那里查

[复制链接]
发表于 2012-6-20 12:03:45 | 显示全部楼层 |阅读模式
_SendMessage

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


Const $WM_RBUTTONDOWN = 0x204  ;右键按下
_SendMessage($Data[5][0],0x0201,0,0)  ;点击指定控件
发表于 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
发表于 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 [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
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-20 13:36 , Processed in 0.077603 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表