xref: /reactos/dll/win32/browseui/settings.cpp (revision 67d5a538)
1 /*
2  * PROJECT:     ReactOS browseui
3  * LICENSE:     LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE:     Stores settings for the file explorer UI.
5  * COPYRIGHT:   Copyright 2023 Carl Bialorucki <cbialo2@outlook.com>
6  */
7 
8 #include "precomp.h"
9 
10 CabinetStateSettings gCabinetState;
11 
12 void ShellSettings::Save()
13 {
14     SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"StatusBarOther",
15                      REG_DWORD, &fStatusBarVisible, sizeof(fStatusBarVisible), SHREGSET_FORCE_HKCU);
16 
17     SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main", L"ShowGoButton",
18                      REG_DWORD, &fShowGoButton, sizeof(fShowGoButton), SHREGSET_FORCE_HKCU);
19 
20     SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Toolbar", L"Locked",
21                      REG_DWORD, &fLocked, sizeof(fLocked), SHREGSET_FORCE_HKCU);
22 }
23 
24 void ShellSettings::Load()
25 {
26     fStatusBarVisible = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main",
27                                              L"StatusBarOther", FALSE, TRUE);
28 
29     fShowGoButton = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Main",
30                                          L"ShowGoButton", FALSE, TRUE);
31 
32     fLocked = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Toolbar",
33                                    L"Locked", FALSE, TRUE);
34 }
35 
36 void CabinetStateSettings::Load()
37 {
38     ReadCabinetState(this, this->cLength);
39 
40     /* Overrides */
41     fFullPathTitle = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState",
42                                           L"FullPath", FALSE, FALSE);
43 
44     fFullPathAddress = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState",
45                                             L"FullPathAddress", FALSE, TRUE);
46 }
47