[program-l] Re: AutoHotKey and File Explorer

  • From: "Travis Roth" <travis@xxxxxxxxxxxxxx>
  • To: <program-l@xxxxxxxxxxxxx>
  • Date: Fri, 7 Jun 2019 09:06:44 -0500

Hey Mike, 

Thanks for your response.

I did some troubleshooting on this. It appears that the #IfWinActive statement 
was not the issue. At least on this system it seems some hot keys will register 
and some will not.

I was testing with ^!c (ctrl+alt+c) and this failed. I changed the keystroke to 
^+i and it started working. So I don’t’ know what is up with that perhaps only 
some types of hotkeys can work inside conditionals? That doesn’t’ make sense to 
me…  But anyways it is something I can work around. 

I’m using Ahk 1.1.25 on Windows 10. I’ve not checked if there is a newer 
version of this in awhile, I should do that. Overall I’m not a big Ahk 
user/expert, just want it to do the occasional small task. 

 

 

From: program-l-bounce@xxxxxxxxxxxxx <program-l-bounce@xxxxxxxxxxxxx> On Behalf 
Of Mike Fox
Sent: Thursday, June 6, 2019 8:38 PM
To: program-l@xxxxxxxxxxxxx
Subject: [program-l] Re: AutoHotKey and File Explorer

 

Hey Travis,

 

What version of AutoHotKey are you using, and what version of Windows?

I have Windows 10 64-bit, and AHK version 1.1.25.01 Unicode 32-bit, and this 
code worked for me:

 

#ifWinActive ahk_class CabinetWClass`
^p::
MsgBox Yup, it works!
return

 

If I hit Control P in Notepad, I got a print dialog.  If I hit it in File 
Explorer, no matter what directory it was on, I got my message box and no print 
dialog.

 

So without seeing any of your code, I don't see a reason why the #ifWinActive 
directive wouldn't work.  Could it be that the hotkey is working, but the code 
it calls is going wrong?  Hard to tell with no code, but hopefully my little 
test script will help you debug it. :)

 

 

On Thu, Jun 6, 2019 at 8:56 AM Travis Roth <travis@xxxxxxxxxxxxxx 
<mailto:travis@xxxxxxxxxxxxxx> > wrote:

Hi, 
Any AutoHotKey experts here?
I am trying to make a hot key that is only active in File Explorer. 
According to Stack Overflow this directive should work: 
#IfWinActive ahk_class CabinetWClass

I also confirmed that the CabinetWClass window class still does exist as the
top window in File Explorer. 
However, this is not working for me and my hot key never becomes active. 
Anyone know the solution? 
Thanks.
Travis


** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx ;
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx <mailto:program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx ;
<mailto:program-l-request@xxxxxxxxxxxxx> ?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx <mailto:program-l-request@xxxxxxxxxxxxx>  
with the Subject:- faq

Other related posts: