mirror of
https://github.com/reactos/reactos.git
synced 2024-11-28 22:13:34 +08:00
[SHELL32] Fix "Open With..." spamming registry MRU keys. (#2685)
CORE-16981 The problem: ============ - When opening "Open With..." dialog for a given file format, multiple MRU items are appended to registry : 2 items written, even if dialog is closed "cancel". - Expected behavior : 1 MRU item if execute is selected and 0 MRU if cancel is selected. Fix: ==== - MRU item to be added when "Execute" is selected only. - Once added, set the presence flag to avoid multiple MRU items being added later.
This commit is contained in:
parent
5cd5598ea9
commit
cd6e1c73c0
@ -534,8 +534,6 @@ VOID COpenWithList::LoadFromProgIdKey(HKEY hKey, LPCWSTR pwszExt)
|
||||
{
|
||||
StringCbCopyW(pApp->wszCmd, sizeof(pApp->wszCmd), wszCmd);
|
||||
SetRecommended(pApp);
|
||||
if (!pApp->bMRUList)
|
||||
AddAppToMRUList(pApp, pwszExt);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -653,6 +651,9 @@ BOOL COpenWithList::AddAppToMRUList(SApp *pApp, LPCWSTR pwszFilename)
|
||||
/* Insert the entry */
|
||||
AddMRUStringW(hList, pApp->wszFilename);
|
||||
|
||||
/* Set MRU presence */
|
||||
pApp->bMRUList = TRUE;
|
||||
|
||||
/* Close MRU list */
|
||||
FreeMRUList(hList);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user