Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This question already has an answer here:

I would like to have an AHK script be disabled when I have the Microsoft Visual Studio window activated (basically, when I'm in it). How could I do that?

#IfWinNotActive Model (Debugging) - Microsoft Visual Studio (Administrator)
SetCapsLockState, AlwaysOff
SetNumLockState, AlwaysOn
SetScrollLockState, AlwaysOff
F1::Send !{F4}



share|improve this question

marked as duplicate by Raystafarian, Karan, Shekhar, gronostaj, mpy Jul 18 '13 at 8:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Also check here and here – Raystafarian Jul 15 '13 at 12:14
Thanks for the links. I checked them out and have updated the question with what I have now in the script (it still doesn't work, I assume because the ahk_class for MS Visual Studio is not a fixed name, but something in the form of: 'ahk_class HwndWrapper[DefaultDomain;;7018e796-0eb5-41c9-8893-cbf68445dc49]', with the final string varying for every instance of VS. Any ideas how to solve this? – jlo Jul 16 '13 at 6:36
try using wingetclass to find it – Raystafarian Jul 16 '13 at 9:21
wingetclass displays the same ahk_class than AHK window spy, it does not work -functionality remains the same in or outside VS. I updated the code above. – jlo Jul 16 '13 at 10:05
did you try #ifwinactive, Microsoft Visual Studio or variants based on your edition? – Raystafarian Jul 16 '13 at 10:10

1 Answer 1

Sure, use the #ifwinactive protocol to set up "profiles" dependent on which window you are in.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.