Jump to content

Recommended Posts

Posted

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 ?

Posted

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

Posted

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 :(

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
Posted

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.

Posted

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

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

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