AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

winactivate brings window to front, but not focus anymore

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
urlwolf



Joined: 16 Mar 2006
Posts: 148

PostPosted: Fri May 01, 2009 2:37 pm    Post subject: winactivate brings window to front, but not focus anymore Reply with quote

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
View user's profile Send private message
crxvfr



Joined: 10 Mar 2006
Posts: 89

PostPosted: Fri May 01, 2009 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
WilliamGatesIII
Guest





PostPosted: Fri May 01, 2009 3:19 pm    Post subject: Reply with quote

Click --> New program window appears behind all other open windows on a Windows 2000-based, Windows XP-based, Windows Server 2003-based, or Windows Vista-based computer
Back to top
sinkfaze



Joined: 18 Mar 2008
Posts: 5044
Location: the tunnel(?=light)

PostPosted: Fri May 01, 2009 3:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
urlwolf



Joined: 16 Mar 2006
Posts: 148

PostPosted: Fri May 01, 2009 9:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group