Context sensitive (#IfWinActive) doesn't work
Context sensitive (#IfWinActive) doesn't work
Does anybody know why sometimes general scripts work, but do not do scripts inside #IfWinActive? The program does not generate messages of error, either.
Re: Context sensitive (#IfWinActive) doesn't work
Can you give an example? #IfWinActive only affects hotkeys that are defined following that directive. Those hotkeys will only work if the result of your #IfWinActive is true.
Re: Context sensitive (#IfWinActive) doesn't work
My usual script is very large, but, here you have an example :
F2::
Run notepad ; IT WORKS
Return
#IfWinActive ahk_class CabinetWClass
!3:: ; IT DOESN'T WORK
Run calc
Return
#IfWinActive
::::::::::::::::::::::
I must make it clear that it does not always happen. I suspect that some function of windows, or of another program that works in the background in some situation, can disable this. I can not explain what it can be. I just rebooted the computer, and everything worked again, but I would like to avoid this action.
Thanks in advance
F2::
Run notepad ; IT WORKS
Return
#IfWinActive ahk_class CabinetWClass
!3:: ; IT DOESN'T WORK
Run calc
Return
#IfWinActive
::::::::::::::::::::::
I must make it clear that it does not always happen. I suspect that some function of windows, or of another program that works in the background in some situation, can disable this. I can not explain what it can be. I just rebooted the computer, and everything worked again, but I would like to avoid this action.
Thanks in advance
Re: Context sensitive (#IfWinActive) doesn't work
One possibility:
What Windows OS are you using?
You could try this to check the class of the active window:
Code: Select all
#IfWinActive ahk_class CabinetWClass
!3::
#IfWinActive ahk_class ExploreWClass
!3::
Run calc
Return
#IfWinActive
You could try this to check the class of the active window:
Code: Select all
q:: ;get class of active window
WinGetClass, vWinClass, A
MsgBox, % vWinClass
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Context sensitive (#IfWinActive) doesn't work
Thanks for your time,
My Windows is 8.1
My Windows is 8.1