NanaZip
NanaZip copied to clipboard
Context menu windows 11 duplicated
hi i notice the context menu is duplicted under show more options and the windows 11 context menu so if im on windows 11 it should only show up when i right click but not under show more options
i have made temporary fix to it
It's not duplicated due to some third-party apps like Everything will show the classic context menu in their UI. But I think next version of NanaZip will try to add an option for achieve your idea.
Kenji Mouri
any update on it don't mind helping
I trust this contribution proves valuable to you.
bool IsWindows11OrLater()
{
OSVERSIONINFOEX osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
osvi.dwBuildNumber = 22000; // Minimum build number for Windows 11
DWORDLONG dwlConditionMask = 0;
VER_SET_CONDITION(dwlConditionMask, VER_BUILDNUMBER, VER_GREATER_EQUAL);
return VerifyVersionInfo(&osvi, VER_BUILDNUMBER, dwlConditionMask);
}
IFACEMETHODIMP GetState(_In_opt_ IShellItemArray* selection, _In_ BOOL okToBeSlow, _Out_ EXPCMDSTATE* cmdState)
{
bool isWindows11OrLater = IsWindows11OrLater();
if (isWindows11OrLater)
{
if (selection && okToBeSlow)
{
*cmdState = ECS_ENABLED;
return S_OK;
}
*cmdState = ECS_HIDDEN; // Hides the classic context menu on Windows 11
}
else
{
// Handle other cases, if necessary.
*cmdState = ECS_ENABLED; // Show the context menu item by default on other versions.
}
return S_OK;
}
@modz2014
I will try to integrate that in recent days.
Kenji Mouri
did you want me to create a pull request I don't mind
did you want me to create a pull request I don't mind
I think I will make some modifications. So, I will make a git co-authored commit with you.
I hope you can provide me something like that:
Co-authored-by: NAME [email protected]
Kenji Mouri
Co-authored-by: Modz2014 [email protected] is this what you want sorry I'm a bit confused
is this what you want sorry I'm a bit confused
It can help me to create a commit about those changes co-authored with you.
Kenji Mouri
Ok is that all you need
@MouriNaruto, I've also observed certain aspects of the user interface that require adjustments. As I await your guidance, I'd like to draw attention to the size of elements such as "Extract" and other options, which currently appear quite large. It would greatly enhance the visual harmony of the UI if we could resize these elements slightly, ensuring they maintain a reasonable size consistent with the file toolbar. This adjustment would not only improve aesthetics but also contribute to a cleaner overall appearance. Additionally, I'm contemplating the inclusion of an Inno Setup .ssi file, though its necessity is still under consideration. Your insights on this matter would be greatly appreciated.
@MouriNaruto is there going to be new updates to this soon
@MouriNaruto can i send you some archive formats to be added i tried to add them myself but the porject is all the place for me to understand i can email them to you
can i send you some archive formats to be added i tried to add them myself but the porject is all the place for me to understand i can email them to you
Of course, you can.
Kenji Mouri
ok what is your email address
@MouriNaruto i sent they now sorry i had to finish up
@MouriNaruto I'm trying to add Inno Setup scripts, but it seems a lot harder are you working on adding this as well as other installer
@MouriNaruto ill create a pull request with some changes in the next hour or something for you
I won't accept the suggestion and the PR of hiding NanaZip item in the legacy context menu because there is no proper way to implement.
Due to packaged shell extensions running out of process, we cannot check the process is File Explorer or third-party applications which need shell extensions. (For example, the common open and save dialog.)
Due to many people may like to select all files in the folder which the file count is large like the System32 folder, it's not suitable for using okToBeSlow to optimize.
Kenji Mouri
@MouriNaruto wait im confused do you mean about the context menu showing up the new windows 11 one stay hidden under show more options
do you mean about the context menu showing up the new windows 11 one stay hidden under show more options
Yes, the common open and save dialog only uses the legacy context menu.
Kenji Mouri
can you screenshot to me because it works fine for me
can you screenshot to me because it works fine for me
The simplest way to show what I said is using the Browse dialog when you use Windows Run dialog.
Kenji Mouri
Also, when you open File Explorer via Windows Tools in the Start menu, you will always use legacy context menu.
Kenji Mouri
ok i added in checks for this it should work now I will update it later
@MouriNaruto hope this helps
IFACEMETHODIMP GetState(_In_opt_ IShellItemArray* selection, _In_ BOOL okToBeSlow, _Out_ EXPCMDSTATE* cmdState)
{
bool isWindows11OrLater = IsWindows11OrLater();
if (isWindows11OrLater)
{
if (selection && okToBeSlow)
{
*cmdState = ECS_ENABLED;
return S_OK;
}
*cmdState = ECS_HIDDEN;
}
if (IsActiveWindowDialog())
{
*cmdState = ECS_ENABLED;
}
else
{
*cmdState = ECS_HIDDEN; // Hides the classic context menu on Windows 11 for non-Save dialog scenarios
}
return S_OK;
}
bool IsDialog(const WCHAR* className)
{
return wcscmp(className, L"#32770") == 0;
}`
Sorry, it's not helpful for out-of-process shell extensions.
Kenji Mouri
@MouriNaruto Please explain