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 

apply #ifwinactive to more than one window class

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



Joined: 30 Aug 2009
Posts: 10

PostPosted: Sun Dec 06, 2009 1:52 am    Post subject: apply #ifwinactive to more than one window class Reply with quote

I have a #ifwinactive section that I want to apply to two window classes

MediaPlayerClassicW
MPC D3D Fullscreen

The section is rather long and I don't want to duplicated it since if I need to change something I have to change both.

This doesn't work

Code:

#IfWinActive, ahk_class MediaPlayerClassicW
#IfWinActive, ahk_class MPC D3D Fullscreen
.......
#IfWinActive
#IfWinActive


since of course it just doesn't catch the inner condition.

is this possible? thanks
Back to top
View user's profile Send private message
JohnnyTwoTone



Joined: 10 May 2009
Posts: 45

PostPosted: Sun Dec 06, 2009 2:16 am    Post subject: Reply with quote

not sure if you can do it with #ifwinactive but something like this should work
http://www.autohotkey.com/docs/commands/Hotkey.htm

Code:
hotkey, ifwinactive, ahk_class Notepad
hotkey, #s, sendtext
hotkey, ifwinactive, ahk_class WordPadClass
hotkey, #s, sendtext
Return

sendtext:
   send wtf
   Return
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Sun Dec 06, 2009 3:45 am    Post subject: Reply with quote

Make a group for the window classes with GroupAdd.
Back to top
View user's profile Send private message Visit poster's website
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