the foundation of registry save/restore has been laid, thanks a ton to vxiiduu#4598
This commit is contained in:
@@ -83,8 +83,8 @@ BOOL IsProgMgrDefaultShell()
|
|||||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WINLOGON_KEY,
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WINLOGON_KEY,
|
||||||
0, KEY_READ, &hKeyWinlogon) == ERROR_SUCCESS)
|
0, KEY_READ, &hKeyWinlogon) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
if (RegQueryValueEx(hKeyWinlogon, L"Shell", 0,
|
if (RegQueryValueEx(hKeyWinlogon, L"Shell", 0, &dwType,
|
||||||
&dwType, (LPBYTE)szShell, &dwBufferSize) == ERROR_SUCCESS)
|
(LPBYTE)szShell, &dwBufferSize) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
if (StrStr(szShell, szProgMgr))
|
if (StrStr(szShell, szProgMgr))
|
||||||
{
|
{
|
||||||
@@ -112,7 +112,8 @@ BOOL IsProgMgrDefaultShell()
|
|||||||
|
|
||||||
/* * * *\
|
/* * * *\
|
||||||
SaveConfig -
|
SaveConfig -
|
||||||
Finds and collapses all settings and saves them to the registry.
|
Finds and collapses all settings
|
||||||
|
and saves them to the registry.
|
||||||
RETURNS -
|
RETURNS -
|
||||||
TRUE if successful, FALSE if unsuccessful.
|
TRUE if successful, FALSE if unsuccessful.
|
||||||
\* * * */
|
\* * * */
|
||||||
@@ -127,7 +128,8 @@ BOOL SaveConfig()
|
|||||||
(bSaveSettings * PMS_SAVESETTINGS);
|
(bSaveSettings * PMS_SAVESETTINGS);
|
||||||
|
|
||||||
// Save settings bitmask
|
// Save settings bitmask
|
||||||
if (RegSetValueEx(hKeySettings, pszSettingsMask, 0, REG_DWORD, &dwSettingsMask, sizeof(DWORD)) == ERROR_SUCCESS)
|
if (RegSetValueEx(hKeySettings, pszSettingsMask, 0, REG_DWORD,
|
||||||
|
&dwSettingsMask, sizeof(DWORD)) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -137,22 +139,25 @@ BOOL SaveConfig()
|
|||||||
|
|
||||||
/* * * *\
|
/* * * *\
|
||||||
BOOL LoadConfig() -
|
BOOL LoadConfig() -
|
||||||
Finds all settings and retrieves them from the registry.
|
Finds all settings and retrieves them
|
||||||
|
from the registry.
|
||||||
RETURNS -
|
RETURNS -
|
||||||
TRUE if successful, FALSE if unsuccessful.
|
TRUE if successful, FALSE if unsuccessful.
|
||||||
\* * * */
|
\* * * */
|
||||||
BOOL LoadConfig()
|
BOOL LoadConfig()
|
||||||
{
|
{
|
||||||
DWORD dwBufferSize = 0;
|
DWORD dwType;
|
||||||
|
DWORD dwBufferSize = sizeof(dwSettingsMask);
|
||||||
|
|
||||||
// Load settings bitmask
|
// Load settings bitmask
|
||||||
if (RegGetValue(hKeySettings, L"", pszSettingsMask, RRF_RT_DWORD, NULL, &dwSettingsMask, &dwBufferSize))
|
if (RegQueryValueEx(hKeySettings, pszSettingsMask, 0, &dwType,
|
||||||
|
&dwSettingsMask, &dwBufferSize) == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
bAutoArrange = ((dwSettingsMask & PMS_AUTOARRANGE) == PMS_AUTOARRANGE);
|
bAutoArrange = (dwSettingsMask & PMS_AUTOARRANGE);
|
||||||
bMinOnRun = ((dwSettingsMask & PMS_MINONRUN) == PMS_MINONRUN);
|
bMinOnRun = (dwSettingsMask & PMS_MINONRUN);
|
||||||
bTopMost = ((dwSettingsMask & PMS_TOPMOST) == PMS_TOPMOST);
|
bTopMost = (dwSettingsMask) & (PMS_TOPMOST);
|
||||||
bSaveSettings = ((dwSettingsMask & PMS_SAVESETTINGS) == PMS_SAVESETTINGS);
|
bSaveSettings = (dwSettingsMask & PMS_SAVESETTINGS);
|
||||||
bShowUsername = ((dwSettingsMask & PMS_SHOWUSERNAME) == PMS_SHOWUSERNAME);
|
bShowUsername = (dwSettingsMask & PMS_SHOWUSERNAME);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
// Settings Bitmask Values (DWORD)
|
// Settings Bitmask Values (DWORD)
|
||||||
#define PMS_AUTOARRANGE 0x00000001
|
#define PMS_AUTOARRANGE 0x00000001
|
||||||
#define PMS_MINONRUN 0x00000002
|
#define PMS_MINONRUN 0x00000002
|
||||||
#define PMS_TOPMOST 0x00000008
|
#define PMS_TOPMOST 0x00000004
|
||||||
#define PMS_SHOWUSERNAME 0x00000004
|
#define PMS_SHOWUSERNAME 0x00000008
|
||||||
#define PMS_SAVESETTINGS 0x00000010
|
#define PMS_SAVESETTINGS 0x00000010
|
||||||
|
|
||||||
/* Global Variables */
|
/* Global Variables */
|
||||||
|
|||||||
Reference in New Issue
Block a user