Just to follow up, I ended up using the status bar text to access the FileMenu Tools. However, I used ShellContextMenu for a script to find what's locking my drive, for example, when a flash drive refuses to eject. Below is the main script - I use AltGr+U followed by the letter of the drive I want to unlock. I'm using
WhoLockMe for the underlying unlocker, but
Unlocker is good too (both are free):
Code:
<^>!u::
Input, locked, T3 L1, {esc}, c, i, j, k, l, z
SetKeyDelay, -1
Run WhoLockMe.ahk
Sleep, 500
if locked = c
ShellContextMenu("C:\")
else if locked = i
ShellContextMenu("I:\")
else if locked = j
ShellContextMenu("J:\")
else if locked = k
ShellContextMenu("K:\")
else if locked = l
ShellContextMenu("L:\")
else if locked = z
ShellContextMenu("Z:\")
return
Here's my WhoLockMe.ahk script with SetTimer. It uses
MenuSelectItem function from the linked post by Lexikos with UseMouse = True. (With UseMouse = False the function sometimes selects the context menu item above the one I specify...)
Code:
#Persistent
SetTimer, WhoLockMe, 500
return
WhoLockMe:
IfWinNotExist, ahk_class #32768
return
SetTimer, WhoLockMe, Off ;timer off if context menu detected
MenuSelectItem("Who Lock Me ? ...")
GoSub, WhoLockExit
return
WhoLockExit:
Sleep, 1000
ExitApp
return
Not sure you need the WhoLockExit subroutine in this case, but I needed it to access submenus with some other context menu scripts. Again, this seems to work fine for me, but I have only used it a little bit...