From d13fc4f8aff3b19252f1aa8d707b6f2893c89158 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Mon, 30 Aug 2021 04:03:15 +0300 Subject: [PATCH] Initial commit --- .gitignore | 1 + ArchiveMenu.sln | 31 ++++ ArchiveMenu/ArchiveMenu.vcxproj | 160 +++++++++++++++++++ ArchiveMenu/ArchiveMenu.vcxproj.filters | 37 +++++ ArchiveMenu/icon1.ico | Bin 0 -> 45451 bytes ArchiveMenu/main.c | 198 ++++++++++++++++++++++++ ArchiveMenu/resource.h | 16 ++ ArchiveMenu/resource.rc | 110 +++++++++++++ README.md | 13 +- 9 files changed, 564 insertions(+), 2 deletions(-) create mode 100644 ArchiveMenu.sln create mode 100644 ArchiveMenu/ArchiveMenu.vcxproj create mode 100644 ArchiveMenu/ArchiveMenu.vcxproj.filters create mode 100644 ArchiveMenu/icon1.ico create mode 100644 ArchiveMenu/main.c create mode 100644 ArchiveMenu/resource.h create mode 100644 ArchiveMenu/resource.rc diff --git a/.gitignore b/.gitignore index dfcfd56..f9bb2f7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +icon.ico # User-specific files *.rsuser diff --git a/ArchiveMenu.sln b/ArchiveMenu.sln new file mode 100644 index 0000000..4c58450 --- /dev/null +++ b/ArchiveMenu.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ArchiveMenu", "ArchiveMenu\ArchiveMenu.vcxproj", "{6AC1C44D-B074-4339-900F-1A4810C476CA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Debug|x64.ActiveCfg = Debug|x64 + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Debug|x64.Build.0 = Debug|x64 + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Debug|x86.ActiveCfg = Debug|Win32 + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Debug|x86.Build.0 = Debug|Win32 + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Release|x64.ActiveCfg = Release|x64 + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Release|x64.Build.0 = Release|x64 + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Release|x86.ActiveCfg = Release|Win32 + {6AC1C44D-B074-4339-900F-1A4810C476CA}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {772519A0-397A-4790-AE3F-29D6E7095AEE} + EndGlobalSection +EndGlobal diff --git a/ArchiveMenu/ArchiveMenu.vcxproj b/ArchiveMenu/ArchiveMenu.vcxproj new file mode 100644 index 0000000..e9e902f --- /dev/null +++ b/ArchiveMenu/ArchiveMenu.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {6ac1c44d-b074-4339-900f-1a4810c476ca} + ArchiveMenu + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ArchiveMenu/ArchiveMenu.vcxproj.filters b/ArchiveMenu/ArchiveMenu.vcxproj.filters new file mode 100644 index 0000000..96ff9ae --- /dev/null +++ b/ArchiveMenu/ArchiveMenu.vcxproj.filters @@ -0,0 +1,37 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/ArchiveMenu/icon1.ico b/ArchiveMenu/icon1.ico new file mode 100644 index 0000000000000000000000000000000000000000..5d06b9f2857b39f0b5d3395e3e7999ba6bcc3a38 GIT binary patch literal 45451 zcmeHQ2V4`$_n!>`f|LYoh=qWPSiy=FB49<4^YlDC1oTw&lwubJvRJ^5oLDFdo((IW z*bpR96!ApE*^r{)4iE(uM5G8w{xgB)x2_3AY2KgtFnKfc-n{pHZ`JR%LyWA^>Ijs5h#!!DKZ6<{ARP;Z)WQ z%>g()gwV$Z;XMI(w3^Td>rl`75JDdtETRL@{VV`mZLBA#x6x?>)v8aLXgM8elUh`Q z#BO=`LR4EZeS$eS_n^ybSfM+OojMkPKmAlI=0Z$B#ciVP3IH_XP{!`KhR+9}P530s zu`|}%zkP1CsB3a3{`*Xq&9AyUKAzJjCUVX{?Yi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qyp$SeXkth;|bupq`0N{TphVzg9pHRYI z=s)rstD*{3RJn>WtEg@jHLIdrNKxFR@s!T)BE^*wXEaZX4KoL3;{W;JELdqxwMGD* zlhO4>2y;VSC(*SEuhlRVfO0ksXqSq=Rt(U#)Ng-(f4R?!>pQ+gx~hE2uPp|I@Ab7& zn>?YnzV@m2iS?}$xW0G$gdeq0YJ3R!Z}p$hL;XH9dXGx}4m7e)$dbzqWuJJLg}y~c ze5aQDPK#`lTy7})Kg#5HQbZd;iC8q0ee}+h&`r>q-lI08{hHp3%6kvmkoE~( zHGPv0#e|R}mm4bngl>7?#3S1zmmAtXfrCnsO>!pq-)f(%vp(fk`<36jYKZs~u_VWz z+(wjT(dM*IUK`t(*MC`llWoHogf^x9`r1a=i0wr9Lf+Q3m5DxxevR#hvj4TVW!WeD zRG0F%*siiK9e*P|b+Jd5`BvLi_R+l$F<$>#>W6fFZG!gEJ&-gGUxCH(YwiAj>?eI} z0Dns1YB0D2jM=~$=`@3x3$vsEKJh4kYuQTCI<~5Wo>Q=3X2VQ8r{K_GrIAv7_a`b0 z)SrCJ)l^2Z^7_~1Tv}UyVjN0Pq!ZyGXl?z8?`g{#S0g<&^(W5(MfR!xv!J&Ag#Tph z1a5-XWS{6SYkq2d`V)Gnv@ZC`u_kPyHX_#rKiMwP57DY~`4`VikWR!W_an+gf1)px vHI}#k5wcVo5)y*8y8vc3wJ)k8`?X}$7ah_Kn$R;(zCt~-GL&alJ}>=0A=}t% literal 0 HcmV?d00001 diff --git a/ArchiveMenu/main.c b/ArchiveMenu/main.c new file mode 100644 index 0000000..67b4b20 --- /dev/null +++ b/ArchiveMenu/main.c @@ -0,0 +1,198 @@ +#pragma comment(linker,"\"/manifestdependency:type='win32' \ +name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ +processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#include +#include +#include +#include +#pragma comment(lib, "Shlwapi.lib") +#include + +#define CLASS_NAME L"ArchiveMenu" +#define OPEN_NAME L"&Open archive" +#define EXTRACT_NAME L"&Extract to \"%s\\\"" +#define OPEN_CMD L"\"C:\\Program Files\\7-Zip\\7zFM.exe\" %s" +#define EXTRACT_CMD L"\"C:\\Program Files\\7-Zip\\7zG.exe\" x -o\"%s\" -spe %s" + +DEFINE_GUID(__uuidof_TaskbarList, + 0x56FDF344, + 0xFD6D, 0x11d0, 0x95, 0x8A, + 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90 +); +DEFINE_GUID(__uuidof_ITaskbarList, + 0x56FDF342, + 0xFD6D, 0x11d0, 0x95, 0x8A, + 0x00, 0x60, 0x97, 0xC9, 0xA0, 0x90 +); + +DWORD WINAPI SendCommandLineThread(HWND hWnd) +{ + COPYDATASTRUCT st; + st.cbData = wcslen(PathGetArgsW(GetCommandLineW())) * sizeof(TCHAR); + st.lpData = PathGetArgsW(GetCommandLineW()); + st.dwData = 1; + SendMessage( + FindWindow(L"ArchiveMenuWindowExplorer", NULL), + WM_COPYDATA, + hWnd, + &st + ); + TerminateProcess( + OpenProcess( + PROCESS_TERMINATE, + FALSE, + GetCurrentProcessId() + ), + 0 + ); +} + +int WINAPI wWinMain( + _In_ HINSTANCE hInstance, + _In_opt_ HINSTANCE hPrevInstance, + _In_ LPWSTR lpCmdLine, + _In_ int nShowCmd +) +{ + SetProcessDpiAwarenessContext( + DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 + ); + + HRESULT hr = CoInitialize(NULL); + ITaskbarList* pTaskList = NULL; + hr = CoCreateInstance( + &__uuidof_TaskbarList, + NULL, + CLSCTX_ALL, + &__uuidof_ITaskbarList, + (void**)(&pTaskList) + ); + hr = pTaskList->lpVtbl->HrInit(pTaskList); + + WNDCLASS wc = { 0 }; + wc.style = CS_DBLCLKS; + wc.lpfnWndProc = DefWindowProc; + wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); + wc.hInstance = GetModuleHandle(NULL); + wc.lpszClassName = CLASS_NAME; + wc.hCursor = LoadCursorW(NULL, IDC_ARROW); + RegisterClass(&wc); + + HWND hWnd = CreateWindowEx( + 0, + CLASS_NAME, + 0, + WS_POPUP, + 0, + 0, + 0, + 0, + 0, + 0, + hInstance, + NULL + ); + ShowWindow(hWnd, SW_SHOW); + hr = pTaskList->lpVtbl->DeleteTab(pTaskList, hWnd); + + BOOL canShowToast = FALSE; + PROCESSENTRY32 pe32 = { 0 }; + pe32.dwSize = sizeof(PROCESSENTRY32); + HANDLE hSnapshot = CreateToolhelp32Snapshot( + TH32CS_SNAPPROCESS, + 0 + ); + if (Process32First(hSnapshot, &pe32) == TRUE) + { + do + { + if (!wcscmp(pe32.szExeFile, TEXT("explorer.exe"))) + { + canShowToast = TRUE; + break; + } + } while (Process32Next(hSnapshot, &pe32) == TRUE); + } + + CloseHandle(hSnapshot); + + if (canShowToast && FindWindow(L"ArchiveMenuWindowExplorer", NULL)) + { + CreateThread(0, 0, SendCommandLineThread, hWnd, 0, 0); + + MSG msg = { 0 }; + while (GetMessage(&msg, NULL, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + TerminateProcess( + OpenProcess( + PROCESS_TERMINATE, + FALSE, + GetCurrentProcessId() + ), + 0 + ); + } + + POINT pt; + GetCursorPos(&pt); + + HMENU hMenu = CreatePopupMenu(); + TCHAR buffer[MAX_PATH + 100]; + TCHAR filename[MAX_PATH]; + ZeroMemory(filename, MAX_PATH * sizeof(TCHAR)); + memcpy(filename, PathGetArgsW(GetCommandLineW()), wcslen(PathGetArgsW(GetCommandLineW())) * sizeof(TCHAR)); + PathUnquoteSpacesW(filename); + PathRemoveExtensionW(filename); + PathStripPathW(filename); + wsprintf(buffer, EXTRACT_NAME, filename); + + InsertMenu(hMenu, 0, MF_BYPOSITION | MF_STRING, 1, buffer); + InsertMenu(hMenu, 0, MF_BYPOSITION | MF_STRING, 2, OPEN_NAME); + BOOL res = TrackPopupMenu( + hMenu, + TPM_RETURNCMD, + pt.x - 10, + pt.y - 10, + 0, + hWnd, + 0 + ); + if (res == 1 || res == 2) + { + TCHAR buffer[MAX_PATH + 100]; + ZeroMemory(buffer, (MAX_PATH + 100) * sizeof(TCHAR)); + if (res == 2) + { + wsprintf(buffer, OPEN_CMD, PathGetArgsW(GetCommandLineW())); + } + else if (res == 1) + { + TCHAR path[MAX_PATH]; + ZeroMemory(path, MAX_PATH * sizeof(TCHAR)); + memcpy(path, PathGetArgsW(GetCommandLineW()), wcslen(PathGetArgsW(GetCommandLineW())) * sizeof(TCHAR)); + PathUnquoteSpacesW(path); + PathRemoveExtensionW(path); + wsprintf(buffer, EXTRACT_CMD, path, PathGetArgsW(GetCommandLineW())); + } + STARTUPINFO info = { sizeof(info) }; + PROCESS_INFORMATION processInfo; + BOOL b = CreateProcess( + NULL, + buffer, + NULL, + NULL, + TRUE, + CREATE_UNICODE_ENVIRONMENT, + NULL, + NULL, + &info, + &processInfo + ); + } + + return 0; +} \ No newline at end of file diff --git a/ArchiveMenu/resource.h b/ArchiveMenu/resource.h new file mode 100644 index 0000000..14908b4 --- /dev/null +++ b/ArchiveMenu/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc +// +#define IDI_ICON1 102 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/ArchiveMenu/resource.rc b/ArchiveMenu/resource.rc new file mode 100644 index 0000000..35cbcbe --- /dev/null +++ b/ArchiveMenu/resource.rc @@ -0,0 +1,110 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "VALINET Solutions SRL" + VALUE "FileDescription", "Archive Menu" + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "ArchiveM.exe" + VALUE "LegalCopyright", "Copyright (C) 2006-2021 VALINET Solutions SRL.. All rights reserved." + VALUE "OriginalFilename", "ArchiveM.exe" + VALUE "ProductName", "Archive Menu" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON "C:\\Users\\root\\Documents\\Visual Studio 2019\\Projects\\ArchiveMenu\\icon.ico" + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/README.md b/README.md index 6e2d244..c2c59f2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,11 @@ -# ArchiveMenu -Archive Menu attempts a simple fix for the lack of easy archive extraction on Windows 11. Just associate your archive formats with it, and when double clicking an archive, a popup menu will show, allowing you to open or extract the contents, using 7zip. +# Archive Menu + +Archive Menu attempts a simple fix for the lack of easy archive extraction on Windows 11. Just associate your archive formats with it, and when double clicking an archive, a popup menu will show, allowing you to open or extract the contents, using 7zip. + +If you have [ExplorerPatcher](https://github.com/valinet/ExplorerPatcher) installed, the menu is skinned the same way the Win+X menu is skinned. + +This is not a definite solution, but a workaround in the meantime until 7zip gets updated with Windows 11 context menu support or I take the time to learn how to do it myself. + +To compile, place an `.ico` file in the folder where you cloned the project. + +Precompiled binaries are available in [Releases](https://github.com/valinet/archivemenu/releases). \ No newline at end of file