Makalele Posted October 4, 2008 Posted October 4, 2008 Hi i got small problem I wrote a bot which uses ControlClick for Clicking (not MouseClick), but i need to send to program mouse is on specified position (but not moving my mouse ). Piece of code from my pickit: MouseMove($ItemX,$ItemY1+1,1) - works great, but i want use this: ControlClick($hwnd, "", $Main, "Left",1,$PickingX2,$PickingY1) - sometimes works like MouseMove, but sometimes it clicks Any ideas ?
Andreik Posted October 4, 2008 Posted October 4, 2008 Hi i got small problem I wrote a bot which uses ControlClick for Clicking (not MouseClick), but i need to send to program mouse is on specified position (but not moving my mouse ). Piece of code from my pickit:MouseMove($ItemX,$ItemY1+1,1) - works great, but i want use this:ControlClick($hwnd, "", $Main, "Left",1,$PickingX2,$PickingY1) - sometimes works like MouseMove, but sometimes it clicks Any ideas ?Try this:Some controls will resist clicking unless they are the active window. Use the WinActivate() function to force the control's window to the top before using ControlClick().
Makalele Posted October 4, 2008 Author Posted October 4, 2008 Try this:window is always active but it works randomly, sometimes works as click sometimes it works like mousemove. if i change clicks to 2 it always clicks
Gee Posted October 4, 2008 Posted October 4, 2008 (edited) Hi My Function For $i = 1500 To 1550 _click("Window 1", $i); because ControlID : 1500 --> 1550 Next Func _click($Win, $BTN_ID) Local $check_click WinWaitNotActive($Win) $check_click = ControlClick($Win,"",$BTN_ID) If $check_click = 1 Then Sleep(1000) Exit EndIf EndFunc It exit before execute click and It only work when it run single Why ? Edited October 4, 2008 by Gee
Andreik Posted October 4, 2008 Posted October 4, 2008 Hi My Function For $i = 1500 To 1550 _click("Window 1", $i); because ControlID : 1500 --> 1550 Next Func _click($Win, $BTN_ID) Local $check_click WinWaitNotActive($Win) $check_click = ControlClick($Win,"",$BTN_ID) If $check_click = 1 Then Sleep(1000) Exit EndIf EndFunc It exit before execute click Why ? Because you have a line in your function "Exit". So when the function is called the first time, when reaching line "Exit" the script will be terminate.
Gee Posted October 4, 2008 Posted October 4, 2008 It isn't click . I used "Exit" when ControlID = true , It will click and exit , If not "Exit" it running --> $i = 1550 --> slow
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