Force Window Forward

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
gta31977
Newbie
Posts: 2
Joined: Tue May 05, 2020 5:56 pm

Force Window Forward

Post by gta31977 » Tue May 05, 2020 6:51 pm

Hi – I wrote a very simple script that launches my desktop VPN client and then waits (via image recognition) for the VPN to be successfully connected before launching my Torrent program. The script works great about 85% of the time, but, sometimes if the VPN client goes behind another window, the image recognition part of the script doesn't work. I tried both the Set Focus and Move Window commands to force the window to come forward to no avail. Thanks for any help you can provide! :-)

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Force Window Forward

Post by Grovkillen » Wed May 06, 2020 9:06 am

Use the command line instead:

Code: Select all

//rasdial "Name" "User name" "Password"

//rasdial "VPN connection name" "user" "pw" <--- to connect to VPN
//rasdial /disconnect <--- to disconnect VPN
Let>ME=%Script%

Running: 15.0.24
version history

gta31977
Newbie
Posts: 2
Joined: Tue May 05, 2020 5:56 pm

Re: Force Window Forward

Post by gta31977 » Wed May 06, 2020 4:56 pm

Thanks a lot for the tip. Unfortunately, if I connect to the VPN without using the desktop client, I lose the "kill switch" functionality which is crucial to prevent ISP from snooping. So, any thoughts on how I could force that desktop client window to come forward? Thanks! :-)

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Force Window Forward

Post by Grovkillen » Sun May 10, 2020 4:34 am

I don't know what the kill switch do? Can't that be manipulated using MS at a later stage?

And have you looked into widow handles? It's the numerical (integer) id of a visual object in Windows. If you find and use that you can even "click" on things not visible.
Let>ME=%Script%

Running: 15.0.24
version history

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts