Jump to content
Advert

Recommended Posts

Posted

For some reason I can't get mouseclickplus to work on any of my tests. It used to work with just the exact code I have posted there but for some reason it wont work anymore. Does anyone have any solutions or different methods to send clicks to minimized windows?

Opt("MouseCoordMode", 0)

sleep(5000)
Func _MouseClickPlus($Window, $Button = "left", $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("untitled - Paint","left",500,300,1)
Advert
Posted

Ive never had any problem with ControlClick() with MouseClick() yes it has to be visible but ControlClick() it doesnt

Can you give me an example with clicking in paint? I tried with controlclick and it didnt work.

Posted

opt("MouseCoordMode", 2)
HotKeySet("{END}", "Draw")

While 1
    Sleep(5000)
WEnd

Func Draw()
    For $i = 200 to 600
        ControlClick("untitled - Paint", "", "[CLASS:Afx:1000000:8; INSTANCE:1]", "Left", 1, $i, $i)
    Next
EndFuncoÝ÷ ÚØ^­ëìZ^¡øhÂÚ­¬)ÞÊ«y©eÊåÊwvØb±«­¢+Ù
½¹Ñɽ±
±¥¬ ÅÕ½Ðíչѥѱ´A¥¹ÐÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðím
1MLéàèÄÀÀÀÀÀÀèàì%9MQ9
èÅtÅÕ½Ðì°ÅÕ½Ðí1ÐÅÕ½Ðì°Ä°`°d¤

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
×
×
  • Create New...