
Force Window Forward
Moderators: JRL, Dorian (MJT support)
Force Window Forward
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! 

- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Force Window Forward
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
Re: Force Window Forward
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! 

- Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: Force Window Forward
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.
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.