Jump to content

Recommended Posts

Posted

Hi,

The following is my script for auto clicking within a program call Wnd. With this codes, the control click function still runs although the program Wnd is in the background.

Dim $On
Dim $handle = WinGetHandle("Wnd")

While 1
    While $On = True
    ControlClick( $handle, "", "" ,"left" , 1 , 441 , 106 )
    Sleep(800)
    ControlClick( $handle, "", "" ,"left" , 1 , 441 , 106 )
    Sleep(5000)
    WEnd
    Sleep(100)
WEnd

I wanted to add a mouse drag function but it doesn't work within the program.

I tried MouseClickDrag and it targes my whole monitor screen. May I ask for guidance on how to use MouseClickDrag within the program Wnd only?

Thank you very much.

Posted
  On 7/13/2016 at 12:29 PM, AutoBert said:

That's easy just exit the inner loop when window is not active:

Dim $On
Dim $handle = WinGetHandle("Wnd")

While 1
    While $On = True
        If Not WinActive($handle) Then ExitLoop
        ControlClick($handle, "", "", "left", 1, 441, 106)
        Sleep(800)
        ControlClick($handle, "", "", "left", 1, 441, 106)
        Sleep(5000)
    WEnd
    Sleep(100)
WEnd

 

Expand  

Hello, Thank you very much for your reply.

However, as i have tested, the controlclick from the original codes can be use even when the window is in the background.

However, the ControlClick does not make the mouse cursor drag. 

Is there any other way that you can advise besides the Control Click to achieve the mouse drag behavior?

Thank you very much for your kind response.

Posted

Why would you need a mouse drag behavior on a background window? What do you expect the mouse in the foreground window to do then?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

the reason is so that I can still use my monitor for something else while the sequence is running.

:)

Anyway, i got it sorted out already.

Thank you very much for your help.

Posted

Would you please be so kind to post your solution so it might be useful for other users in the future?

My UDFs and Tutorials:

  Reveal hidden contents

 

Posted

Hi, to be honest, It's not as fantastic as what you all think.

Is just that i sacrifice my screen while letting the sequence run.

That's all.

But I'm quite curious, is there a limitation to Windows Operating System that there wasn't a "ControlClickDrag" programmed in AutoIT?

Posted
  On 7/13/2016 at 5:40 PM, CrvzLee said:

Apology for the double reply as i could not find the edit button. in my research, i found something like this   https://www.autoitscript.com/forum/topic/147988-controlclick-down-and-up/ but i couldnt get it incorporated to my sequence. So i end up giving up.

Expand  

and something call ControlMove (https://www.autoitscript.com/autoit3/docs/functions/ControlMove.htm) which i can't seem to get it to work. Any advise? 

  9 minutes ago, CrvzLee said:

 

 

Expand  

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...