jackyyll Posted December 13, 2005 Posted December 13, 2005 Can someone please help me with this? I really need silent clicking would improve my both 100%. The one thats on the forums just doesnt work..
seandisanti Posted December 13, 2005 Posted December 13, 2005 Can someone please help me with this? I really need silent clicking would improve my both 100%. The one thats on the forums just doesnt work..sorry... not sure what you mean by silent? Does ControlClick() work?
jackyyll Posted December 13, 2005 Author Posted December 13, 2005 I mean like, it clicks places w/o physicaly moving the mouse pointer.
Valuater Posted December 13, 2005 Posted December 13, 2005 maybe ControlClick() look it up in help 8)
seandisanti Posted December 13, 2005 Posted December 13, 2005 I mean like, it clicks places w/o physicaly moving the mouse pointer.like ControlClick() does.... ok, try ControlClick()....
Moderators SmOke_N Posted December 14, 2005 Moderators Posted December 14, 2005 Larry made a UDF for something like this a while back using actual coords:Opt("WinTitleMatchMode",4) ClickInControl("left","Program Manager","","SysListView321",30,10) Func ClickInControl( $szLR, $szTitle, $szText, $szControl, $nX, $nY ) If $szLR <> "left" And $szLR <> "right" Then Return 0 $hWnd = ControlGetHandle( $szTitle, $szText, $szControl ) If @error Then Return 0 $hWndDad = WinGetHandle( $szTitle, $szText ) If @error Then Return 0 $me = DLLCall( "kernel32.dll", "long", "GetCurrentThreadId" ) $you = DLLCall( "user32.dll", "long", "GetWindowThreadProcessId", "hwnd", $hWndDad, "long_ptr", 0) $coord = _MakeLong( $nX, $nY ) If $szLR = "left" Then $msg1 = 0x0201;WM_LBUTTONDOWN $msg2 = 0x0202;WM_LBUTTONUP $i = 0x0001;MK_LBUTTON Else $msg1 = 0x0204;WM_RBUTTONDOWN $msg2 = 0x0205;WM_RBUTTONUP $i = 0x0002;MK_RBUTTON EndIf $ret = DLLCall("user32.dll","int","AttachThreadInput","long",$me[0],"long",$you[0],"int",1) If $ret[0] = 0 Then Return 0 $ret = DLLCall("user32.dll","long","PostMessage","hwnd",$hWnd,"int",$msg1,"int",$i,"int",$coord) If $ret[0] = 0 Then Return 0 Sleep(100) $ret = DLLCall("user32.dll","long","PostMessage","hwnd",$hWnd,"int",$msg2,"int",0,"int",$coord) If $ret[0] = 0 Then Return 0 DLLCall("user32.dll","int","AttachThreadInput","long",$me[0],"long",$you[0],"int",0) If $ret[0] = 0 Then Return 0 Return 1 EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFuncWarningI'm not always able to get it to work with every window. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
seandisanti Posted December 14, 2005 Posted December 14, 2005 WarningI'm not always able to get it to work with every window.for the others do you use ControlClick() ? /smirk sorry, too many energy drinks today...
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