Sign in to follow this  
Followers 0
Makalele

Control Click problem

6 posts in this topic

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 :P ). 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 :idea:

Any ideas ?


Share this post


Link to post
Share on other sites



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 :P ). 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 :idea:

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().


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Try this:

window is always active :P but it works randomly, sometimes works as click sometimes it works like mousemove. if i change clicks to 2 it always clicks :(


Share this post


Link to post
Share on other sites

#4 ·  Posted (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 :P Why ?

Edited by Gee

Share this post


Link to post
Share on other sites

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 :P 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.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

It isn't click . I used "Exit" when ControlID = true , It will click and exit ,

If not "Exit" it running --> $i = 1550 --> slow

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