From 371ffbc069b7eee102a01bf0f237b8412d11897d Mon Sep 17 00:00:00 2001 From: Moshe Katz Date: Thu, 27 Feb 2014 18:34:37 -0500 Subject: [PATCH 1/2] Add registration for right-click on folder item; Add context-menu icon Existing code registered right-click only for blank areas of the Explorer window. This change adds a menu item for right-clicking on a folder in the file list. Also adds the program's icon to help find it in a crowded context menu. --- Cmder.exe | Bin 31744 -> 32256 bytes launcher/src/CmderLauncher.cpp | 57 +++++++++++++++++++++------------ 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/Cmder.exe b/Cmder.exe index e84dd932bb9506d304c2e1a922d061a3dad9c6fa..664bafca78369ce55f6958c25c7221f4c9051401 100644 GIT binary patch delta 6026 zcmd^CdstIfw%;cNh=LFm1Vkz-537tOoV-Lx;y}fd;~aL~$ynZA!=V zkUQ$Jz23Id+NtB%sr|-kAKGgz6|dS}YaiE9J2I`)GJc1`wCc6ib{Nn7?ZczCf6f2* z}4^0OoJC*ro%XhnV`Bbed-0=)VUE&$+ z_M~lyVY}TLS+eJp?Qkr15bk&tfIZ?%00akC!GIz#moHT|giQ1Ocf%4ieq!t4VOt7m zgK}WnmS}#9Y9RV;Y84DDDHaaPqnwfQJ>q;!BDOAjr2MFuj|C}U7S^qlk~6Whiiqu~ zo&Rr<9}kfM7!_oEkJyq#NKYkyt%)=-k>#o4U!Y3I{8{m14A=Io;s+0JQxhVdOcJg~ z&t7~Q3T$^}L%8$CKP4&Bc@uZ1U3_JX-S-`3U%?&hr^eWW|Df!za0fe-B-F+vXLw|( zJ0XS;*gNqxMV!PPh>9dZh*=!xE}=n`mlFOKbMNGP$H8lT9ySy@p&sEcj?I}6m`uQl zk979ZD)_h9*}+qtt*}&rU7qTE1|xz!NXZ&#Ih+zJ2QoUOAG{wwwj)-DJ=AC$=KQq~H-vP&9fL-4+7U!iPRf_K+r_Iuu-#5@4wCMCA8E7?JJRBb|rgliLda>|!~}K~|zV2#Xp`GLjyd6OmVe zAPIue-P*;8QK+3mw{6+NXe)w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LC8E-S@BIzuW9x%RW>_fuuD%@6hpzs8~XXu4!N0YBJ=*+re9lJ~S zkZy0`zQO{N!BlK2H91XfrfsIZrv0XmP3KMV=47+kTxM=C3+A2XUFQAf*Rl&fX8s$q C= _WIN32_WINNT_WIN7) #define MB_TITLE L"Cmder Launcher" -#define SHELL_MENU_REGISTRY_PATH L"Directory\\Background\\shell\\Cmder" +#define SHELL_MENU_REGISTRY_PATH_BACKGROUND L"Directory\\Background\\shell\\Cmder" +#define SHELL_MENU_REGISTRY_PATH_LISTITEM L"Directory\\shell\\Cmder" #define streqi(a, b) (_wcsicmp((a), (b)) == 0) @@ -154,30 +155,42 @@ HKEY GetRootKey(std::wstring opt) return root; } -void RegisterShellMenu(std::wstring opt) +void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName) { - HKEY root = GetRootKey(opt); - - HKEY cmderKey; - FAIL_ON_ERROR( - RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); - - FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL)); - FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2)); - - HKEY command; - FAIL_ON_ERROR( - RegCreateKeyEx(cmderKey, L"command", 0, NULL, - REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL)); + // First, get the paths we will use wchar_t exePath[MAX_PATH] = { 0 }; + wchar_t icoPath[MAX_PATH] = { 0 }; GetModuleFileName(NULL, exePath, sizeof(exePath)); wchar_t commandStr[MAX_PATH + 20] = { 0 }; swprintf_s(commandStr, L"\"%s\" \"%%V\"", exePath); + // Now that we have `commandStr`, it's OK to change `exePath`... + PathRemoveFileSpec(exePath); + + PathCombine(icoPath, exePath, L"icons\\cmder.ico"); + + // Now set the registry keys + + HKEY root = GetRootKey(opt); + + HKEY cmderKey; + FAIL_ON_ERROR( + RegCreateKeyEx(root, keyBaseName, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); + + FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL)); + FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2)); + + FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"Icon", 0, REG_SZ, (BYTE *)icoPath, sizeof icoPath)); + + HKEY command; + FAIL_ON_ERROR( + RegCreateKeyEx(cmderKey, L"command", 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL)); + FAIL_ON_ERROR(RegSetValue(command, L"", REG_SZ, commandStr, NULL)); RegCloseKey(command); @@ -185,15 +198,15 @@ void RegisterShellMenu(std::wstring opt) RegCloseKey(root); } -void UnregisterShellMenu(std::wstring opt) +void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName) { HKEY root = GetRootKey(opt); HKEY cmderKey; FAIL_ON_ERROR( - RegCreateKeyEx(root, SHELL_MENU_REGISTRY_PATH, 0, NULL, + RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL)); - FAIL_ON_ERROR(RegDeleteKey(root, SHELL_MENU_REGISTRY_PATH)); + FAIL_ON_ERROR(RegDeleteKey(root, keyBaseName)); RegCloseKey(cmderKey); RegCloseKey(root); } @@ -215,11 +228,13 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } else if (streqi(opt.first.c_str(), L"/REGISTER")) { - RegisterShellMenu(opt.second); + RegisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_BACKGROUND); + RegisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_LISTITEM); } else if (streqi(opt.first.c_str(), L"/UNREGISTER")) { - UnregisterShellMenu(opt.second); + UnregisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_BACKGROUND); + UnregisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_LISTITEM); } else { From 447be262f8ccc25ddf2973d520a76da5287ad567 Mon Sep 17 00:00:00 2001 From: Moshe Katz Date: Thu, 27 Feb 2014 18:44:46 -0500 Subject: [PATCH 2/2] A better way to find string length --- Cmder.exe | Bin 32256 -> 32256 bytes launcher/src/CmderLauncher.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Cmder.exe b/Cmder.exe index 664bafca78369ce55f6958c25c7221f4c9051401..4bb4df18c642232c9206fb22e24ee6950f154b8a 100644 GIT binary patch delta 1766 zcmY*Zdr%Wc7~hQ$Lc&ACLjsDB1Oc)2j=Nj}A$R8^)}cirVkl}6wb~SI6@|{I2wJ2g z4FPd$?b~9h(<#=f88MEGqKwu@=xE!~wtuK?tvxK`R4Y~`ntq3ru{*Q(eY?Nk_t@X= z+@=8D6u{f=EAo3=A132Q5%TSl30?6GX)y5*!<82@w}Y`Fd)81yvUfNzOI`jQj^ zNJhXP24wIOd;zQ>8N)F&^kh^qLH-rzdD{uvJbwQ5cp}mkUc)6jwO6@ud`uD9O z)75mi4K_>UT4bYo98Mq~s57E!qTw7BD&NqdYsm$*4i}S~>M1yeBx>yVDk;~bV1{hg z#NcPh4vh)+&uenV9u9!OGmIGZ z(j@O-v=if9q-e~olr~UZIz9?6$fkmKf~q52v3fXm+!wMS(n(UT)hWlML4nz%PWuAh zLHybZXu=%B;Ok^XOcp*zcE(%`v%yvNz}2sc)#Vg}AFNhMMPTb~3#UWc($Z=b^pFcX zrLOQ0)Gb+M_a*tMZtgci{feJBo%5Ra7&r)o?zNmXeXGq4Zg7S z!yuaYa(vdiGJZgT&ypp&S8x|Or(2I-CicVwb>G|sO$(a(&fI=tyN9h0th?B#@=S|x z=Wk)oNR9VkBR>FM9e6&UMMQn|aJQZURiFE5vILZcB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{n;qXs|EiVKeJ@AWIx5cqybfq6@S84nJO{@%8YQM)`aCS&ng{vC-31tcRR!>odN zfXqus^@xg95JNU3L|TXA736}cjY-I^*}f_J-@ePFJj|kD+Nh5F|9+TUP1uBAAy!i= z7Rd%vYWVL-%0uSFl+`6a+IzR1GhHaGOA{6gs|367q0lSn#Q-ru6vP~Ho!Bg%5`Pih zVz7Cxd69XAx!PP~-eu-8GBbuUmS?WcyqP(eIXlal6`F0zo}b;4-IYDV(rUSA`PTA- z<&I^{GHIbCUnx|IlH#RgDNW*}4Cy(kP%4#HO6#Sql3m&(HA-*SNr$Co>6rAf)GGBz z-$^5qj~p#0%V{zr7s{n_xx7-|DDRXT;#7WpR1j z%iKC{H}@WQf*a(9IX!RSb9fuSoZrEJ#b4oX@`L1$F1FO@n`r&NDRO&Q diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index c155330..42d3d22 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -184,7 +184,7 @@ void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName) FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL)); FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2)); - FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"Icon", 0, REG_SZ, (BYTE *)icoPath, sizeof icoPath)); + FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"Icon", 0, REG_SZ, (BYTE *)icoPath, wcslen(icoPath) * sizeof(wchar_t))); HKEY command; FAIL_ON_ERROR(