[New+]Don't override New actions from Explorer on Windows 10 (#36467)
* [New+]Don't override New actions from Explorer * Update src/modules/NewPlus/NewShellExtensionContextMenu.win10/shell_context_menu_win10.cpp * Update src/modules/NewPlus/NewShellExtensionContextMenu.win10/shell_context_menu_win10.cpp * Add pattern for learn.microsoft links * Also only Query for context menu
This commit is contained in:
Родитель
e4d2deb89e
Коммит
a720dd537c
|
@ -131,7 +131,7 @@ _mm_(?!dd)\w+
|
|||
|
||||
# hit-count: 4 file-count: 4
|
||||
# microsoft
|
||||
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|developer|docs|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%]*
|
||||
\b(?:https?://|)(?:(?:(?:blogs|download\.visualstudio|developer|docs|learn|msdn2?|research)\.|)microsoft|blogs\.msdn)\.co(?:m|\.\w\w)/[-_a-zA-Z0-9()=./%#]*
|
||||
|
||||
aka\.ms/[a-zA-Z0-9]+
|
||||
|
||||
|
|
|
@ -38,9 +38,9 @@ IFACEMETHODIMP shell_context_menu_win10::QueryContextMenu(HMENU menu_handle, UIN
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (menu_flags & CMF_DEFAULTONLY)
|
||||
if (menu_flags & (CMF_DEFAULTONLY | CMF_VERBSONLY | CMF_OPTIMIZEFORINVOKE))
|
||||
{
|
||||
return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0);
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -217,6 +217,13 @@ IFACEMETHODIMP shell_context_menu_win10::InvokeCommand(CMINVOKECOMMANDINFO* para
|
|||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (HIWORD(params->lpVerb)!=0)
|
||||
{
|
||||
// Not a menu command. It's likely a string verb command from another menu.
|
||||
// The logic to interpret lpVerb is explained here: https://learn.microsoft.com/en-us/previous-versions//bb776881(v=vs.85)#invokecommand-method
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Get selected menu item (a template or the "Open templates" item)
|
||||
const auto selected_menu_item_index = LOWORD(params->lpVerb) - 1;
|
||||
if (selected_menu_item_index < 0)
|
||||
|
|
Загрузка…
Ссылка в новой задаче