janjo Posted February 24, 2020 Share Posted February 24, 2020 Hi, For using on a remote computer, I wrote a script that starts a program so that a 3G internet connection starts. This program comes with the 3G dongle from TP-LINK model MA260. The script (.exe) is executed by windows Task Scheduler at predefined times. The 3G connection program is a special one, see attached picture, it's window has no title bar and it starts as a process not an application. The process name is "3GUtility.exe" Things like: WinWaitActive(...) or WinActivate(...) do not work. Everything works, but sometimes there are other windows on the desktop and the window I need to start the connection, by clicking the "Connect" button, gets behind them and so the script clicks in the correct coordinates but on the wrong window. Please take a look at my script and maybe someone know a solution for this. In the script I wrote a comment where I would like to make sure the process window is in front of all other before I click the button. No need to say that before asking here, I've already read many messages and spend many hours trying for a solution but unfortunately without success. Thank you and best wishes, Janjos autoitstart3G_V2.au3 Link to comment Share on other sites More sharing options...
rm4453 Posted March 6, 2020 Share Posted March 6, 2020 Why not minimize everything on the desktop with Win+D and then activate it to pull up the window? Link to comment Share on other sites More sharing options...
paw Posted March 8, 2020 Share Posted March 8, 2020 Get the program title and class with Autoit Window Info tool and use that to activate it like $tc = "[TITLE:Mozilla Firefox; CLASS:MozillaWindowClass]" WinActivate($tc) Or get the window handle from the PID after starting itFAQ#How_can_I_get_a_window_handle_when_all_I_have_is_a_PID Link to comment Share on other sites More sharing options...
rm4453 Posted March 9, 2020 Share Posted March 9, 2020 On 3/8/2020 at 7:31 AM, paw said: Get the program title and class with Autoit Window Info tool and use that to activate it like $tc = "[TITLE:Mozilla Firefox; CLASS:MozillaWindowClass]" WinActivate($tc) Or get the window handle from the PID after starting itFAQ#How_can_I_get_a_window_handle_when_all_I_have_is_a_PID He already stated that doesn't work here: On 2/24/2020 at 2:30 PM, janjo said: Things like: WinWaitActive(...) or WinActivate(...) do not work. autoitstart3G_V2.au3 1.82 kB · 10 downloads Link to comment Share on other sites More sharing options...
rm4453 Posted March 9, 2020 Share Posted March 9, 2020 https://www.autoitscript.com/autoit3/docs/functions/WinSetOnTop.htm Link to comment Share on other sites More sharing options...
Bert Posted March 11, 2020 Share Posted March 11, 2020 I wonder if the application supports command line switches. That may be a simple way to make it work. Another option is to see if the connection is a service that is being turned on and off. If yes, that can be done by command line also. Look in your services and see if you can find something to do with tp-link. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now