Sign in to follow this  
Followers 0
Zamp

How can I right click and something thats minimized?

5 posts in this topic

I know you can use controlclick, but the thing I want to click on has the same control ID as a lot of other stuff. And then everything in the menu from the right click has the same controlID. Is there a way I can have it click on a certain one?

Share this post


Link to post
Share on other sites



I know you can use controlclick, but the thing I want to click on has the same control ID as a lot of other stuff. And then everything in the menu from the right click has the same controlID. Is there a way I can have it click on a certain one?

_ClickInControl()

_MouseClickPlus()

_CtrlGetByPos()

Search for these functions in the Search option of the forum. That's as much as I can provide for your obfuscated question.


[center]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.[/center]

Share this post


Link to post
Share on other sites

I can't get _MouseClickPlus() to work. I included it at the top of my script, then after it I put :

_MouseClickPlus("Zenx [Ver. 7.113.000.2] netsurfer", "left", 211, 370, 1)

but it doesn't work. I run the script but nothing happens. It's supposed to click on a button and open a new window, but it doesn't.

Share this post


Link to post
Share on other sites

Post your entire code, not just one line so we can see what the problem is.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Func _MouseClickPlus($Window, $Button = "", $X = "", $Y = "", $Clicks = 1)
  Local $MK_LBUTTON    =  0x0001
  Local $WM_LBUTTONDOWN   =  0x0201
  Local $WM_LBUTTONUP    =  0x0202
 
  Local $MK_RBUTTON    =  0x0002  
  Local $WM_RBUTTONDOWN   =  0x0204
  Local $WM_RBUTTONUP    =  0x0205

  Local $WM_MOUSEMOVE    =  0x0200
 
  Local $i              = 0
 
  Select
  Case $Button = "left"
     $Button     =  $MK_LBUTTON
     $ButtonDown =  $WM_LBUTTONDOWN
     $ButtonUp   =  $WM_LBUTTONUP
  Case $Button = "right"
     $Button     =  $MK_RBUTTON
     $ButtonDown =  $WM_RBUTTONDOWN
     $ButtonUp   =  $WM_RBUTTONUP
  EndSelect
 
  If $X = "" OR $Y = "" Then
     $MouseCoord = MouseGetPos()
     $X = $MouseCoord[0]
     $Y = $MouseCoord[1]
  EndIf
 
  For $i = 1 to $Clicks
     DllCall("user32.dll", "int", "SendMessage", _
        "hwnd",  WinGetHandle( $Window ), _
        "int",   $WM_MOUSEMOVE, _
        "int",   0, _
        "long",  _MakeLong($X, $Y))
       
     DllCall("user32.dll", "int", "SendMessage", _
        "hwnd",  WinGetHandle( $Window ), _
        "int",   $ButtonDown, _
        "int",   $Button, _
        "long",  _MakeLong($X, $Y))
       
     DllCall("user32.dll", "int", "SendMessage", _
        "hwnd",  WinGetHandle( $Window ), _
        "int",   $ButtonUp, _
        "int",   $Button, _
        "long",  _MakeLong($X, $Y))
  Next
EndFunc




Func _MakeLong($LoWord,$HiWord)
  Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc

_MouseClickPlus("Zenx [Ver. 7.113.000.2] netsurfer", "left", 211, 370, 1)

I did a search for MouseClickPlus and found everything above the last line, then just pasted it in there.

Edited by Zamp

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  
Followers 0