Reactos

[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.

authored by

Carl J. Bialorucki and committed by
GitHub
f203ad5c 157491e2

+13 -1
+13 -1
dll/win32/browseui/internettoolbar.cpp
··· 607 607 608 608 CInternetToolbar::CInternetToolbar() 609 609 { 610 + fLocked = SHRegGetBoolUSValueW(L"Software\\Microsoft\\Internet Explorer\\Toolbar", 611 + L"Locked", 612 + FALSE, 613 + TRUE); 614 + 610 615 fMainReBar = NULL; 611 - fLocked = false; 612 616 fMenuBandWindow = NULL; 613 617 fNavigationWindow = NULL; 614 618 fMenuCallback = new CComObject<CMenuCallback>(); ··· 718 722 719 723 if (locked != fLocked) 720 724 { 725 + DWORD dwLocked = locked ? 1 : 0; 726 + SHRegSetUSValueW(L"Software\\Microsoft\\Internet Explorer\\Toolbar", 727 + L"Locked", 728 + REG_DWORD, 729 + &dwLocked, 730 + sizeof(dwLocked), 731 + SHREGSET_FORCE_HKCU); 721 732 fLocked = locked; 733 + 722 734 rebarBandInfo.cbSize = sizeof(rebarBandInfo); 723 735 rebarBandInfo.fMask = RBBIM_STYLE | RBBIM_LPARAM; 724 736 bandCount = (int)SendMessage(fMainReBar, RB_GETBANDCOUNT, 0, 0);