Author: cwittich
Date: Tue Sep 1 13:55:34 2015
New Revision: 68895
URL:
http://svn.reactos.org/svn/reactos?rev=68895&view=rev
Log:
[STOBJECT] only change the volume icon when the state changed
Modified:
trunk/reactos/dll/shellext/stobject/volume.cpp
Modified: trunk/reactos/dll/shellext/stobject/volume.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/stobject/volu…
==============================================================================
--- trunk/reactos/dll/shellext/stobject/volume.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/shellext/stobject/volume.cpp [iso-8859-1] Tue Sep 1 13:55:34 2015
@@ -171,22 +171,32 @@
HRESULT STDMETHODCALLTYPE Volume_Update(_In_ CSysTray * pSysTray)
{
+ BOOL PrevState;
+
TRACE("Volume_Update\n");
+ PrevState = g_IsMute;
Volume_IsMute();
- WCHAR strTooltip[128];
- HICON icon;
- if (g_IsMute) {
- icon = g_hIconMute;
- LoadStringW(g_hInstance, IDS_VOL_MUTED, strTooltip, _countof(strTooltip));
- }
- else {
- icon = g_hIconVolume;
- LoadStringW(g_hInstance, IDS_VOL_VOLUME, strTooltip, _countof(strTooltip));
- }
-
- return pSysTray->NotifyIcon(NIM_MODIFY, ID_ICON_VOLUME, icon, strTooltip);
+ if (PrevState != g_IsMute)
+ {
+ WCHAR strTooltip[128];
+ HICON icon;
+ if (g_IsMute) {
+ icon = g_hIconMute;
+ LoadStringW(g_hInstance, IDS_VOL_MUTED, strTooltip, _countof(strTooltip));
+ }
+ else {
+ icon = g_hIconVolume;
+ LoadStringW(g_hInstance, IDS_VOL_VOLUME, strTooltip, _countof(strTooltip));
+ }
+
+ return pSysTray->NotifyIcon(NIM_MODIFY, ID_ICON_VOLUME, icon, strTooltip);
+ }
+ else
+ {
+ return S_OK;
+ }
}
HRESULT STDMETHODCALLTYPE Volume_Shutdown(_In_ CSysTray * pSysTray)