mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 08:20:27 +00:00
[SHELL32] Enable OpenWith to handle "NoOpenWith" and "NoStartPage" registry keys (#4043)
- Add registry handling of two keys to COpenWithMenu.cpp - Add code to stop OpenWith from using registry entries that should be excluded - Stop logspam when right-click menu testing for OpenWith is done CORE-17816
This commit is contained in:
parent
22d1e7a4e4
commit
17ec81eab8
1 changed files with 27 additions and 7 deletions
|
@ -110,7 +110,7 @@ COpenWithList::~COpenWithList()
|
||||||
|
|
||||||
BOOL COpenWithList::Load()
|
BOOL COpenWithList::Load()
|
||||||
{
|
{
|
||||||
HKEY hKey;
|
HKEY hKey, hKeyApp;
|
||||||
WCHAR wszName[256], wszBuf[100];
|
WCHAR wszName[256], wszBuf[100];
|
||||||
DWORD i = 0, cchName, dwSize;
|
DWORD i = 0, cchName, dwSize;
|
||||||
SApp *pApp;
|
SApp *pApp;
|
||||||
|
@ -131,18 +131,38 @@ BOOL COpenWithList::Load()
|
||||||
|
|
||||||
if (pApp)
|
if (pApp)
|
||||||
{
|
{
|
||||||
StringCbPrintfW(wszBuf, sizeof(wszBuf), L"%s\\shell\\open\\command", wszName);
|
if (RegOpenKeyW(hKey, wszName, &hKeyApp) == ERROR_SUCCESS)
|
||||||
dwSize = sizeof(pApp->wszCmd);
|
|
||||||
if (RegGetValueW(hKey, wszBuf, L"", RRF_RT_REG_SZ, NULL, pApp->wszCmd, &dwSize) != ERROR_SUCCESS)
|
|
||||||
{
|
{
|
||||||
ERR("Failed to add app %ls\n", wszName);
|
if ((RegQueryValueExW(hKeyApp, L"NoOpenWith", NULL, NULL, NULL, NULL) != ERROR_SUCCESS) &&
|
||||||
pApp->bHidden = TRUE;
|
(RegQueryValueExW(hKeyApp, L"NoStartPage", NULL, NULL, NULL, NULL) != ERROR_SUCCESS))
|
||||||
|
{
|
||||||
|
StringCbPrintfW(wszBuf, sizeof(wszBuf), L"%s\\shell\\open\\command", wszName);
|
||||||
|
dwSize = sizeof(pApp->wszCmd);
|
||||||
|
if (RegGetValueW(hKey, wszBuf, L"", RRF_RT_REG_SZ, NULL, pApp->wszCmd, &dwSize) != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("Failed to add app %ls\n", wszName);
|
||||||
|
pApp->bHidden = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRACE("App added %ls\n", pApp->wszCmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pApp->bHidden = TRUE;
|
||||||
|
}
|
||||||
|
RegCloseKey(hKeyApp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
TRACE("App added %ls\n", pApp->wszCmd);
|
{
|
||||||
|
pApp->bHidden = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ERR("AddInternal failed\n");
|
ERR("AddInternal failed\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
|
Loading…
Reference in a new issue