Take the 2-minute tour ×
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}
F2::^+Tab
F3::^Tab
F4::^t
F6::^w
F7::!Esc
F8::#Down
CapsLock::Enter
^Esc::#d
F9::#1
F10::#2
F11::#3
F12::#4

return

Thanks

share|improve this question
2  
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
show 2 more comments

marked as duplicate by Raystafarian, Karan, Shakehar, 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.

1 Answer

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

share|improve this answer
add comment

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