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 

[Solved] How to Make a Window take Focus?

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



Joined: 16 Jun 2008
Posts: 66

PostPosted: Sat Feb 21, 2009 2:59 pm    Post subject: [Solved] How to Make a Window take Focus? Reply with quote

though searched & read some topics in Help,
i don't yet understand what command can make a window take focus
instead of minimizing to the Task Bar when it opens?

when i open Sysinternals Process Explorer,
unless the caret is hovered over the TaskBar,
it opens minimezed, & i'd like it to just open max & take over the screen

my current hotkey is
Code:
#!space:: Run C:\Program Files\Process_Explorer_v11.32.exe, ,max
return
;         **** Sysinternals Process Explorer ****



also, in TweakUI, i disable the "Prevent Applications from Stealing Focus",
because i like apps to take the focus when i activate them !

Thank you for any help


Last edited by geor on Sat Feb 21, 2009 5:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
SoLong&Thx4AllTheFish



Joined: 27 May 2007
Posts: 4999

PostPosted: Sat Feb 21, 2009 4:36 pm    Post subject: Reply with quote

http://www.autohotkey.com/docs/commands/WinActivate.htm
_________________
AHK Wiki FAQ
TF : Text files & strings lib, TF Forum
Back to top
View user's profile Send private message
Frankie



Joined: 02 Nov 2008
Posts: 2850

PostPosted: Sat Feb 21, 2009 4:36 pm    Post subject: Reply with quote

Does this work?
Code:
#!space:: Run C:\Program Files\Process_Explorer_v11.32.exe, , , PID
WinWait, ahk_id %PID%
WinActivate, ahk_id %PID%
Return

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run
Back to top
View user's profile Send private message
geor



Joined: 16 Jun 2008
Posts: 66

PostPosted: Sat Feb 21, 2009 5:43 pm    Post subject: Reply with quote

@Frankie - yes, that works Thanks,

and @HugoV - i did not think of WinActivate to cause focus,
(which Frankie's script contains)
but of course that's its purpose,
so i'll write some other similar scripts so i can learn it better.

Thanks to both of you ~
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