[STOBJECT][MMSYS][POWERCFG] Store the "Show x icon in the taskbar" setting for the hotplug, power and volume icons.

CORE-12365
CORE-12972
CORE-15234
This commit is contained in:
Eric Kohl 2019-04-23 00:04:01 +02:00
parent a7ddabcc12
commit 8fb2a2dd12
2 changed files with 7 additions and 4 deletions

View file

@ -365,7 +365,7 @@ SaveData(HWND hwndDlg)
bShowIcon = (IsDlgButtonChecked(hwndDlg, IDC_ICON_IN_TASKBAR) == BST_CHECKED); bShowIcon = (IsDlgButtonChecked(hwndDlg, IDC_ICON_IN_TASKBAR) == BST_CHECKED);
SetSystrayVolumeIconState(!bShowIcon); SetSystrayVolumeIconState(bShowIcon);
} }
VOID VOID

View file

@ -301,17 +301,20 @@ Adv_InitDialog(VOID)
BOOLEAN bSuspend = FALSE; BOOLEAN bSuspend = FALSE;
BOOLEAN bHibernate; BOOLEAN bHibernate;
BOOLEAN bShutdown; BOOLEAN bShutdown;
BOOL bEnabled;
SYSTEM_POWER_CAPABILITIES spc; SYSTEM_POWER_CAPABILITIES spc;
if (GetSystrayPowerIconState()) bEnabled = GetSystrayPowerIconState();
if (bEnabled)
gGPP.user.GlobalFlags |= EnableSysTrayBatteryMeter; gGPP.user.GlobalFlags |= EnableSysTrayBatteryMeter;
else else
gGPP.user.GlobalFlags &= ~EnableSysTrayBatteryMeter; gGPP.user.GlobalFlags &= ~EnableSysTrayBatteryMeter;
CheckDlgButton(hAdv, CheckDlgButton(hAdv,
IDC_SYSTRAYBATTERYMETER, IDC_SYSTRAYBATTERYMETER,
gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter ? BST_CHECKED : BST_UNCHECKED); bEnabled ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hAdv, CheckDlgButton(hAdv,
IDC_PASSWORDLOGON, IDC_PASSWORDLOGON,
gGPP.user.GlobalFlags & EnablePasswordLogon ? BST_CHECKED : BST_UNCHECKED); gGPP.user.GlobalFlags & EnablePasswordLogon ? BST_CHECKED : BST_UNCHECKED);
@ -501,7 +504,7 @@ Adv_SaveData(HWND hwndDlg)
MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK); MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK);
} }
SetSystrayPowerIconState(!bSystrayBatteryMeter); SetSystrayPowerIconState(bSystrayBatteryMeter);
Adv_InitDialog(); Adv_InitDialog();
} }