I have a computer I set up that starts a few apps and i need one window on that machine to have focus after everything is started up. I don't want to have to log in or hook up a keyboard to do this so is there some software out there that looks at windows names and forces them to have focus? Or like some kind of mouse script that runs and clicks the window after so may seconds after boot? I only need to do it once as once its all started up its just a few windows displaying info.
I have a stick computer that runs winamp and ATCS Monitor and when ATCS Monitor starts it opens 2 windows and I want focus to be the larger window so that everything looks right. Its a Railroad Dispatchers display on a stick!
Picked up a Asus vivo stick and a 1080P 32" tv for $240. It all works great except that window focus issue.
Window Focus
- FlyingPenguin
- Flightless Bird
- Posts: 32783
- Joined: Wed Nov 22, 2000 11:13 am
- Location: Central Florida
- Contact:
Re: Window Focus
This batch file will work:
Replace "app name" with the title of the window (you need to keep the quotes). Spaces okay. Case is not important, and it acts as if a wildcard is on the end.
So for instance, if the title of the window is Moffsoft Calculator 2 (actually just tested this with that very window on my workstation - it's my go-to calculator), then "moffsoft" is really all you need, although it wouldn't hurt to spell out the entire window name to avoid possible name collisions.
So in my example for the Moffsoft Calculator the code looks like this:
Code: Select all
echo (new ActiveXObject("WScript.Shell")).AppActivate("app name"); > focus.js
cscript //nologo focus.js
del focus.js
So for instance, if the title of the window is Moffsoft Calculator 2 (actually just tested this with that very window on my workstation - it's my go-to calculator), then "moffsoft" is really all you need, although it wouldn't hurt to spell out the entire window name to avoid possible name collisions.
So in my example for the Moffsoft Calculator the code looks like this:
Code: Select all
echo (new ActiveXObject("WScript.Shell")).AppActivate("Moffsoft Calculator 2"); > focus.js
cscript //nologo focus.js
del focus.js
Christians warn us about the anti-christ for 2,000 years, and when he shows up, they buy a bible from him.
Re: Window Focus
I take it that batch will have to run later after the window is open? or will it do it when it sees that window if the batch opens first?
Thanks.
Thanks.
Re: Window Focus
Stupid question... Figured it out. Man configuring a new computer will wear you out if you haven't done it in a few years.