Home
Forum
Software
Mouser's Software
NANY: New Apps for the New Year
Friends of DC
Forum Coding Snacks
Editorials
Daily Blog
Monthly Newsletter
Mini Reviews
Favorite Websites
Archives
Articles
Historical Archives
Testimonials: What Folks Say About Us
Licensing
Get a License Key
Commercial Licensing
Help
Search
FAQs
DonationCoder Sitemap
Live Chat (Discord)
Contact Us
About Us
Donate
Home
Forum
Software
Mouser's Software
NANY: New Apps for the New Year
Friends of DC
Forum Coding Snacks
Editorials
Daily Blog
Monthly Newsletter
Mini Reviews
Favorite Websites
Archives
Articles
Historical Archives
Testimonials: What Folks Say About Us
Licensing
Get a License Key
Commercial Licensing
Help
Search
FAQs
DonationCoder Sitemap
Live Chat (Discord)
Contact Us
About Us
Donate
This topic
This board
Entire forum
Website and forum (google)
Member search
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
6 Months
Forever
Login with username, password and session length
Saturday December 14, 2024, 6:09 pm
Proudly celebrating 15+ years online.
Donate now
to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
Forum Home
Search
Login
Register
Recent Topics
Go To..
Recently updated topics
Recent posts (compact)
Recent posts (full text)
DonationCoder.com Forum
»
DonationCoder.com Software
»
Coding Snacks
»
Post New Requests Here
»
Make script work only on specific apps?
« previous
next »
New Topic
Print
Pages: [
1
] •
bottom
Author
Topic: Make script work only on specific apps? (Read 5159 times)
substep
Participant
Joined in 2010
Posts:
6
Make script work only on specific apps?
«
on:
August 12, 2010, 08:22 PM »
Right now this script excludes apps. I want to invert it so it will work only on selected apps (*.exe preferrably).
Code: Autohotkey
[Select]
SetTitleMatchMode
,
2
~
MButton
::
ifwinactive
ahk_class MozillaUIWindowClass
return
ifwinactive
ahk_class Progman
return
ifwinactive
ahk_class Shell_TrayWnd
return
ifwinactive
ahk_class MozillaDialogClass
return
ifwinactive
ahk_class NotifyIconOverflowWindow
return
Send
!
{
F4
}
Return
skwire
Global Moderator
Joined in 2005
Posts:
5,287
Re: Make script work only on specific apps?
«
Reply #1 on:
August 12, 2010, 08:30 PM »
Take a look at the
#IfWinActive
directive in AHK:
http://www.autohotke...nds/_IfWinActive.htm
Target
Honorary Member
Joined in 2006
Posts:
1,832
Re: Make script work only on specific apps?
«
Reply #2 on:
August 12, 2010, 10:01 PM »
simply substitute the returns in your ifwinactive statements for the send routine (and of course you'll need to amend the AHK classes as appropriate)
substep
Participant
Joined in 2010
Posts:
6
Re: Make script work only on specific apps?
«
Reply #3 on:
August 13, 2010, 10:27 AM »
Thx, now it's finished.
Code: Autohotkey
[Select]
SetTitleMatchMode
,
2
#ifwinactive
ahk_class TForm1
~
MButton
::
Send
!
{
F4
}
Return
#ifwinactive
ahk_class TfrmStarter
~
MButton
::
Send
!
{
F4
}
Return
#ifwinactive
ahk_class AkelPad4
~
MButton
::
Send
!
{
F4
}
Return
#ifwinactive
ahk_class mp3DCWndClass
~
MButton
::
Send
!
{
F4
}
Return
#ifwinactive
,
Postbox
~
MButton
::
Send
!
{
F4
}
Return
#ifwinactive
ahk_class XmainClass
~
MButton
::
Send
!
{
F4
}
Return
skwire
Global Moderator
Joined in 2005
Posts:
5,287
Re: Make script work only on specific apps?
«
Reply #4 on:
August 13, 2010, 10:37 AM »
You can shorten it up a bit by using groups.
Code: Autohotkey
[Select]
SetTitleMatchMode
,
2
GroupAdd
,
Alt_F4_Group
,
ahk_class TForm
GroupAdd
,
Alt_F4_Group
,
ahk_class TfrmStarter
GroupAdd
,
Alt_F4_Group
,
ahk_class AkelPad4
GroupAdd
,
Alt_F4_Group
,
ahk_class mp3DCWndClass
GroupAdd
,
Alt_F4_Group
,
ahk_class Postbox
GroupAdd
,
Alt_F4_Group
,
ahk_class XmainClass
#ifwinactive
ahk_group Alt_F4_Group
~
MButton
::
Send
!
{
F4
}
Return
New Topic
Print
Pages: [
1
] •
top
« previous
next »
DonationCoder.com Forum
»
DonationCoder.com Software
»
Coding Snacks
»
Post New Requests Here
»
Make script work only on specific apps?