[EXPLORER][SHELL32][SDK] Show/hide 'Run' menu item (#6592)

Improve Start Menu customization.
JIRA issue: CORE-16956
- Add SHSettingsChanged prototype to
  <undocshell.h>.
- Add SetRestriction helper function.
- Implement showing/hiding Run menu
  item of Start Menu.
This commit is contained in:
Katayama Hirofumi MZ
2024-03-11 10:54:12 +09:00
committed by GitHub
parent ede65b88bc
commit 5daab33c59
6 changed files with 26 additions and 12 deletions

View File

@@ -163,6 +163,15 @@ BOOL SetAdvancedDword(IN LPCWSTR pszValueName, IN DWORD dwValue)
return SetRegDword(REGKEY_ADVANCED, pszValueName, dwValue);
}
BOOL SetRestriction(IN LPCWSTR pszKey, IN LPCWSTR pszValueName, IN DWORD dwValue)
{
WCHAR szSubKey[MAX_PATH] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies";
PathAppendW(szSubKey, pszKey);
SHSetValueW(HKEY_CURRENT_USER, szSubKey, pszValueName, REG_DWORD, &dwValue, sizeof(dwValue));
SHSettingsChanged(NULL, NULL);
return TRUE;
}
BOOL
GetVersionInfoString(IN LPCWSTR szFileName,
IN LPCWSTR szVersionInfo,