Jump to content
Sign in to follow this  
Golbez

control click..

Recommended Posts

Golbez

is there a away 2 set the coords of were it will click xD

i cant figure it out :)

edit: _mousetrap dont work :D

Edited by Golbez

Share this post


Link to post
Share on other sites
SmOke_N

is there a away 2 set the coords of were it will click xD

i cant figure it out :)

edit: _mousetrap dont work :D

No.... is the answer to your question.

A solution however could be _ClickInControl() by Larry..


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.

Share this post


Link to post
Share on other sites
Golbez

No.... is the answer to your question.

A solution however could be _ClickInControl() by Larry..

thanx smoke

Share this post


Link to post
Share on other sites
Golbez

http://www.autoitscript.com/forum/index.ph...=ClickInControl

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

this smoke?

Share this post


Link to post
Share on other sites
Golbez

nvm found it

Edited by Golbez

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×