Bring window to front

Discussion, questions and support.
Post Reply
spotticus
Posts: 9
Joined: Oct 15th, ’19, 17:44

Post by spotticus » Nov 8th, ’19, 18:39

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!
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Nov 9th, ’19, 22:04

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

Post by spotticus » Nov 11th, ’19, 17:53

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.
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Nov 11th, ’19, 22:36

You need to use Type: Command.
spotticus
Posts: 9
Joined: Oct 15th, ’19, 17:44

Post by spotticus » Nov 12th, ’19, 16:39

Sorry I'm a noob! Thanks!!
spotticus
Posts: 9
Joined: Oct 15th, ’19, 17:44

Post by spotticus » Nov 15th, ’19, 17:11

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%
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Nov 15th, ’19, 19:00

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
Post Reply