Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 was marked as an exact duplicate of an existing 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

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 .