## Bring window to front

Discussion, questions and support.
spotticus
Posts: 9
Joined: Oct 15th, ’19, 17:44
I created a shortcut to open a program. It does cause the program to open, but it doesn't bring its window to the front. How do I make the shortcut open the program and bring it to the front (i.e. make it the active window)? Also, in general, how do you tell the computer to make a particular window the up front active window? Thanks!
Tom
Posts: 414
Joined: Nov 24th, ’15, 23:39
This is an operating system issue. Try to use another shortcut (avoid Alt and Win modifiers).
Or use this:

Code: Select all

``````Run, "C:\Program Files (x86)\Folder\software.exe",,, OutputVarPID
WinWait, ahk_pid %OutputVarPID%
WinActivate, ahk_pid %OutputVarPID% ``````
https://www.autohotkey.com/docs/command ... tivate.htm
spotticus
Posts: 9
Joined: Oct 15th, ’19, 17:44
The shortcut I am using is the F6 function key. I am trying to have it open C:\Program Files (x86)\Dentrix\Office.exe - I tried to implement your code but I must be doing something wrong because it is giving me an error and won't even let me save it.
Marko
Posts: 1222
Joined: Mar 2nd, ’13, 21:02
You need to use Type: Command.
spotticus
Posts: 9
Joined: Oct 15th, ’19, 17:44
Sorry I'm a noob! Thanks!!
spotticus
Posts: 9
Joined: Oct 15th, ’19, 17:44
Hmmm.. it still is not bringing up the window:
Run, "C:\Program Files (x86)\Dentrix\Office.exe",,, OutputVarPID
WinWait, ahk_pid %OutputVarPID%
WinActivate, ahk_pid %OutputVarPID%
Tom
Posts: 414
Joined: Nov 24th, ’15, 23:39
Can you try with another software path - does it work?
What happens if you run it using Cmd?
C:\Program Files (x86)\Dentrix\Office.exe