sendmessage函数问题
Local Const $VK_RBUTTON =0x02Local Const $WM_KEYDOWN = 0x0100
Local Const $WM_KEYUP =0x0101
$hwnd = WinGetHandle('')
DllCall("User32.dll","Int" ,"SendMessage","HWnd",$hwnd,"Int", $VK_RBUTTON,"Int",$WM_KEYDOWN,"int","0")
DllCall("User32.dll","Int" ,"SendMessage","HWnd",$hwnd,"Int", $VK_RBUTTON,"Int",$WM_KEYUP,"int","1")请教大侠们上述代码为何不能实现mouseclick("right")的效果? 一个记事本例子
#include <winapi.au3>
Const $WM_RBUTTONDOWN = 0x204
Const $WM_RBUTTONUP = 0x205
Run("notepad.exe")
$Hwnd = WinWaitActive("")
$Hanld = ControlGetHandle($Hwnd,"","Edit1")
$Lparm = _WinAPI_MakeLong(100,105) ;x=100,y=105
;右键按下,弹起,弹出右键菜单
_SendMessage($Hanld,$WM_RBUTTONDOWN,0,$Lparm)
_SendMessage($Hanld,$WM_RBUTTONUP,0,$Lparm)
回复 2# 风行者
#include <winapi.au3>
Const $WM_RBUTTONDOWN = 0x204
Const $WM_RBUTTONUP = 0x205
Run("notepad.exe")
$Hwnd = WinWaitActive("")
$Hanld = ControlGetHandle($Hwnd,"","Edit1")
$Lparm = _WinAPI_MakeLong(100,105) ;x=100,y=105
DllCall("User32.dll","Int" ,"SendMessage","HWnd",$Hanld,"Int", $WM_RBUTTONDOWN,"Int",$WM_KEYDOWN,"int",$Lparm)
DllCall("User32.dll","Int" ,"SendMessage","HWnd",$Hanld,"Int", $WM_RBUTTONUP,"Int",$WM_KEYUP,"int",$Lparm)
把$VK_RBUTTON换成$WM_RBUTTONDOWN,添加坐标,试了是可以达到了
不知道$VK_RBUTTON和$WM_RBUTTONDOWN区别在哪?
页:
[1]