WilliamGatesIII: it's not that the window appears behind. it's on top, but not on focus (i.e., typing will not send chars to that window).
I just realized it's not with all windows.
R (
www.r-project.org) gets focus fine.
vim does too, but the title bar is greyed out.
TotalCommander 7.5 beta 2 does not get focus (typing doesn't work).
WinWaitActive doesn't seem to help. In fact, it doesn't bring up the window at all.
Code:
Any more cues? Thanks
Code:
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function: appShortcut
*/
appShortcut(pathToExe){
StringSplit, array, pathToExe, \
size := array0
process2check := array%size%
;msgbox, %process2check%
process, exist, %process2check%
PID=%errorlevel%
if PID=0
Run, %pathToExe%
else
WinWait, ahk_pid %PID%
WinActivate
Return
}