From 8fb2a2dd12ed238b52d82e658c8726e787fe2070 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 23 Apr 2019 00:04:01 +0200 Subject: [PATCH] [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 --- dll/cpl/mmsys/volume.c | 2 +- dll/cpl/powercfg/advanced.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dll/cpl/mmsys/volume.c b/dll/cpl/mmsys/volume.c index 4c3189bbbe6..b8e546e2763 100644 --- a/dll/cpl/mmsys/volume.c +++ b/dll/cpl/mmsys/volume.c @@ -365,7 +365,7 @@ SaveData(HWND hwndDlg) bShowIcon = (IsDlgButtonChecked(hwndDlg, IDC_ICON_IN_TASKBAR) == BST_CHECKED); - SetSystrayVolumeIconState(!bShowIcon); + SetSystrayVolumeIconState(bShowIcon); } VOID diff --git a/dll/cpl/powercfg/advanced.c b/dll/cpl/powercfg/advanced.c index 6f282728681..6ca281abe6e 100644 --- a/dll/cpl/powercfg/advanced.c +++ b/dll/cpl/powercfg/advanced.c @@ -301,17 +301,20 @@ Adv_InitDialog(VOID) BOOLEAN bSuspend = FALSE; BOOLEAN bHibernate; BOOLEAN bShutdown; + BOOL bEnabled; SYSTEM_POWER_CAPABILITIES spc; - if (GetSystrayPowerIconState()) + bEnabled = GetSystrayPowerIconState(); + + if (bEnabled) gGPP.user.GlobalFlags |= EnableSysTrayBatteryMeter; else gGPP.user.GlobalFlags &= ~EnableSysTrayBatteryMeter; CheckDlgButton(hAdv, IDC_SYSTRAYBATTERYMETER, - gGPP.user.GlobalFlags & EnableSysTrayBatteryMeter ? BST_CHECKED : BST_UNCHECKED); + bEnabled ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hAdv, IDC_PASSWORDLOGON, gGPP.user.GlobalFlags & EnablePasswordLogon ? BST_CHECKED : BST_UNCHECKED); @@ -501,7 +504,7 @@ Adv_SaveData(HWND hwndDlg) MessageBox(hwndDlg, L"WriteGlobalPwrPolicy failed", NULL, MB_OK); } - SetSystrayPowerIconState(!bSystrayBatteryMeter); + SetSystrayPowerIconState(bSystrayBatteryMeter); Adv_InitDialog(); }