| View previous topic :: View next topic |
| Author |
Message |
urlwolf
Joined: 16 Mar 2006 Posts: 148
|
Posted: Fri May 01, 2009 2:37 pm Post subject: winactivate brings window to front, but not focus anymore |
|
|
I'm not sure if it's because I've moved to windows server 2008 64-bit or what, but winactivate brings window to front, but not focus anymore.
I have a lots of shortcuts that use this. The idea is to start using the app right away, not having to click on it.
The same code works as expected in XP. There I run as admin, in windows server 2008 I don't. maybe there's a security setting to prevent focus stealing?
Is this something anyone can relate to?
Thanks! |
|
| Back to top |
|
 |
crxvfr
Joined: 10 Mar 2006 Posts: 89
|
Posted: Fri May 01, 2009 3:03 pm Post subject: |
|
|
Tried winrestore or winactivate?
I have sometimes had to use winrestore to switch to a window because winactivate was maximizing the window, and I didn't want it maximized.
I don't know how that is related but maybe worth a try.
Also if its a startup deal, something may be loading behind it to take the focus away? |
|
| Back to top |
|
 |
WilliamGatesIII Guest
|
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Fri May 01, 2009 3:46 pm Post subject: |
|
|
It's possible that there's something not processing correctly in response to the WinActivate command, you can try following it up with a WinWaitActive command and see if that helps. _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
urlwolf
Joined: 16 Mar 2006 Posts: 148
|
Posted: Fri May 01, 2009 9:41 pm Post subject: |
|
|
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
}
|
|
|
| Back to top |
|
 |
|