Tole Posted September 25, 2006 Share Posted September 25, 2006 Im trying to write a little clicker, to work in minimized mu window. So with Send() it works good when window is visible. But it does nothing with ControlSend or ControlClick. The main idea is press numbers (1..2..3.) and click a mouse when window is minimzed. Im using handle to identify window, and it work correct because i can hide and move window... Func rightclick() while(1) Opt("MouseClickDelay", 20) ControlClick($handleg, "", "", "right") ;MouseClick("right") WEnd EndFunc Link to comment Share on other sites More sharing options...
Tole Posted September 25, 2006 Author Share Posted September 25, 2006 no ideas? Link to comment Share on other sites More sharing options...
Skruge Posted September 25, 2006 Share Posted September 25, 2006 Welcome to the forums. ControlClick needs a target control. What is the result of WinGetClassList? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
AceLoc Posted September 25, 2006 Share Posted September 25, 2006 expandcollapse popupMouseX() 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 ;==>MouseClickPlus Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc ;==>MakeLong Func MouseX() _MouseClickPlus("WINDOW", "BUTTON", X, Y, CLICKS) EndFunc ;==>MouseX this will work fine aswell. (minimized) Thnkz [quote name='AceLoc']I gots new sunglasses there cool.[/quote] Link to comment Share on other sites More sharing options...
Tole Posted September 26, 2006 Author Share Posted September 26, 2006 this will work fine aswell. (minimized)ThnkzWow, thx a lot Works really good Link to comment Share on other sites More sharing options...
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