mirror of
https://github.com/reactos/reactos.git
synced 2026-06-02 09:20:43 +08:00
[SHLWAPI][EXPLORER] Implement OS_SERVERADMINUI (#7051)
OS_SERVERADMINUI changes minor things in Explorer, the most visible is that the default folder view mode changes from large icons to details
This commit is contained in:
@@ -49,6 +49,31 @@ static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
InitializeServerAdminUI()
|
||||
{
|
||||
HKEY hKey = SHGetShellKey(SHKEY_Root_HKCU | SHKEY_Key_Explorer, L"Advanced", TRUE);
|
||||
if (!hKey)
|
||||
return;
|
||||
|
||||
DWORD value, size = sizeof(value), type;
|
||||
DWORD error = SHGetValueW(hKey, NULL, L"ServerAdminUI", &type, &value, &size);
|
||||
if (error || type != REG_DWORD || size != sizeof(value))
|
||||
{
|
||||
// The value doesn't exist or is invalid, calculate and apply a default value
|
||||
value = IsOS(OS_ANYSERVER) && IsUserAnAdmin();
|
||||
SHSetValueW(hKey, NULL, L"ServerAdminUI", REG_DWORD, &value, sizeof(value));
|
||||
if (value)
|
||||
{
|
||||
// TODO: Apply registry tweaks with RegInstallW; RegServerAdmin in the REGINST resource in shell32.
|
||||
#if !ROSPOLICY_SHELL_NODEFKEYBOARDCUES
|
||||
SystemParametersInfo(SPI_SETKEYBOARDCUES, 0, IntToPtr(TRUE), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
#if !WIN7_DEBUG_MODE
|
||||
static BOOL
|
||||
SetShellReadyEvent(IN LPCWSTR lpEventName)
|
||||
@@ -179,6 +204,8 @@ StartWithDesktop(IN HINSTANCE hInstance)
|
||||
/* Initialize CLSID_ShellWindows class */
|
||||
_WinList_Init();
|
||||
|
||||
InitializeServerAdminUI();
|
||||
|
||||
CComPtr<ITrayWindow> Tray;
|
||||
CreateTrayWindow(&Tray);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user