mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 02:56:09 +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()
|
CInternetToolbar::CInternetToolbar()
|
||||||
{
|
{
|
||||||
|
fLocked = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Toolbar",
|
||||||
|
L"Locked",
|
||||||
|
FALSE,
|
||||||
|
TRUE);
|
||||||
|
|
||||||
fMainReBar = NULL;
|
fMainReBar = NULL;
|
||||||
fLocked = false;
|
|
||||||
fMenuBandWindow = NULL;
|
fMenuBandWindow = NULL;
|
||||||
fNavigationWindow = NULL;
|
fNavigationWindow = NULL;
|
||||||
fMenuCallback = new CComObject<CMenuCallback>();
|
fMenuCallback = new CComObject<CMenuCallback>();
|
||||||
|
@ -718,7 +722,15 @@ HRESULT CInternetToolbar::LockUnlockToolbars(bool locked)
|
||||||
|
|
||||||
if (locked != fLocked)
|
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;
|
fLocked = locked;
|
||||||
|
|
||||||
rebarBandInfo.cbSize = sizeof(rebarBandInfo);
|
rebarBandInfo.cbSize = sizeof(rebarBandInfo);
|
||||||
rebarBandInfo.fMask = RBBIM_STYLE | RBBIM_LPARAM;
|
rebarBandInfo.fMask = RBBIM_STYLE | RBBIM_LPARAM;
|
||||||
bandCount = (int)SendMessage(fMainReBar, RB_GETBANDCOUNT, 0, 0);
|
bandCount = (int)SendMessage(fMainReBar, RB_GETBANDCOUNT, 0, 0);
|
||||||
|
|
Loading…
Reference in a new issue