Page 1 of 1

Bring window to front

Posted: Nov 8th, ’19, 18:39
by spotticus
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!

Re: Bring window to front

Posted: Nov 9th, ’19, 22:04
by Tom
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

Re: Bring window to front

Posted: Nov 11th, ’19, 17:53
by spotticus
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.

Re: Bring window to front

Posted: Nov 11th, ’19, 22:36
by Marko
You need to use Type: Command.

Re: Bring window to front

Posted: Nov 12th, ’19, 16:39
by spotticus
Sorry I'm a noob! Thanks!!

Re: Bring window to front

Posted: Nov 15th, ’19, 17:11
by spotticus
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%

Re: Bring window to front

Posted: Nov 15th, ’19, 19:00
by Tom
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