Closed JnLlnd closed 9 years ago
See also this example:
#NoTrayIcon
#NoEnv
#SingleInstance ignore
SetWorkingDir %A_ScriptDir%
Gui, +OwnDialogs
Title := "Copy Path"
CMD = %1%
RegEntry := A_IsCompiled ? """" A_ScriptFullPath """ ""`%1""" : """" A_AhkPath """ """ A_ScriptFullPath """ ""`%1"""
If !CMD {
RegRead, ExistingEntry, HKey_Current_User, Software\Classes\*\shell\%Title%\Command
If (ExistingEntry = RegEntry) {
RegDelete, HKey_Current_User, Software\Classes\*\shell\%Title%
RegDelete, HKey_Current_User, Software\Classes\Folder\shell\%Title%
RegDelete, HKEY_CLASSES_ROOT, lnkfile\%Title%
MsgBox, 0x40, %Title%, Explorer context entry removed.
} Else {
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Classes\*\shell\%Title%\Command, , %RegEntry%
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Classes\Folder\shell\%Title%\Command, , %RegEntry%
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, lnkfile\%Title%\Command, , %RegEntry%
If A_IsCompiled {
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Classes\*\Shell\%Title%,icon, %A_ScriptFullPath%
RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Classes\Folder\shell\%Title%,icon, %A_ScriptFullPath%
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, lnkfile\%Title%,icon, %A_ScriptFullPath%
}
MsgBox, 0x40, %Title%, Explorer context entry added.
}
}
Else MsgBox, 0x40, %Title%, % Clipboard := CMD
ExitApp
See also the OnMessage approach: http://www.autohotkey.com/docs/commands/OnMessage.htm
This issue was moved to JnLlnd/FavoritesPopup#7
See: http://code.jeanlalonde.ca/folderspopup/#comment-8801 and https://mail.google.com/mail/u/0/#inbox/14929f0f2228e04f
Idea: create a compiled script to read folderspopup.ini to get the popup menu hotkey and send this hotkey. Add an item in the Explorer context menu to execute this script.
Note: Explorer context menu when you click on a "white" zone is not the same context menu as when you right-click on a file or folder name/icon. There is also a context menu when you right-click in a dialog box "white" zone.
Examples of adding items to Explorer context menu: http://www.autohotkey.com/board/topic/37423-new-context-menu-item-puts-any-folder-into-a-dialog-window/
Example of registry key: HKEY_CLASSES_ROOT\Folder\shell\Browse with Paint Shop Pro