mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[BROWSEUI] Add locked toolbar state persistence (#5350)
Store the state of the explorer toolbar, locked or unlocked, in the proper registry location and set the proper toolbar state when initialized. CORE-9094 - Set `HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar\Locked` to 1 when the explorer toolbar is locked, 0 when the toolbar is unlocked. - Query `HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar\Locked` when the toolbar is initialized to set the correct locked state. - Set the default state of the toolbar to locked if the registry key does not exist, matching the behavior of Windows Server 2003.
This commit is contained in:
parent
157491e297
commit
f203ad5cf4
1 changed files with 13 additions and 1 deletions
|
@ -607,8 +607,12 @@ HRESULT STDMETHODCALLTYPE CMenuCallback::CallbackSM(LPSMDATA psmd, UINT uMsg, WP
|
|||
|
||||
CInternetToolbar::CInternetToolbar()
|
||||
{
|
||||
fLocked = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Toolbar",
|
||||
L"Locked",
|
||||
FALSE,
|
||||
TRUE);
|
||||
|
||||
fMainReBar = NULL;
|
||||
fLocked = false;
|
||||
fMenuBandWindow = NULL;
|
||||
fNavigationWindow = NULL;
|
||||
fMenuCallback = new CComObject<CMenuCallback>();
|
||||
|
@ -718,7 +722,15 @@ HRESULT CInternetToolbar::LockUnlockToolbars(bool locked)
|
|||
|
||||
if (locked != fLocked)
|
||||
{
|
||||
DWORD dwLocked = locked ? 1 : 0;
|
||||
SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Toolbar",
|
||||
L"Locked",
|
||||
REG_DWORD,
|
||||
&dwLocked,
|
||||
sizeof(dwLocked),
|
||||
SHREGSET_FORCE_HKCU);
|
||||
fLocked = locked;
|
||||
|
||||
rebarBandInfo.cbSize = sizeof(rebarBandInfo);
|
||||
rebarBandInfo.fMask = RBBIM_STYLE | RBBIM_LPARAM;
|
||||
bandCount = (int)SendMessage(fMainReBar, RB_GETBANDCOUNT, 0, 0);
|
||||
|
|
Loading…
Reference in a new issue