diff --git a/dll/shellext/stobject/csystray.cpp b/dll/shellext/stobject/csystray.cpp index d1e51c116e6..d73e67e55d9 100644 --- a/dll/shellext/stobject/csystray.cpp +++ b/dll/shellext/stobject/csystray.cpp @@ -241,8 +241,12 @@ BOOL CSysTray::ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM return TRUE; case WM_TIMER: - UpdateIcons(); + if (wParam == 1) + UpdateIcons(); + else + ProcessIconMessage(uMsg, wParam, lParam, lResult); return TRUE; + case WM_DESTROY: KillTimer(1); ShutdownIcons(); diff --git a/dll/shellext/stobject/hotplug.cpp b/dll/shellext/stobject/hotplug.cpp index 9af5eef972a..ed0660f49ed 100644 --- a/dll/shellext/stobject/hotplug.cpp +++ b/dll/shellext/stobject/hotplug.cpp @@ -280,19 +280,28 @@ HRESULT STDMETHODCALLTYPE Hotplug_Message(_In_ CSysTray * pSysTray, UINT uMsg, W } return S_FALSE; + case WM_TIMER: + if (wParam == HOTPLUG_TIMER_ID) + { + KillTimer(pSysTray->GetHWnd(), HOTPLUG_TIMER_ID); + _ShowContextMenu(pSysTray); + } + break; + case ID_ICON_HOTPLUG: Hotplug_Update(pSysTray); switch (lParam) { case WM_LBUTTONDOWN: + SetTimer(pSysTray->GetHWnd(), HOTPLUG_TIMER_ID, 500, NULL); break; case WM_LBUTTONUP: - _ShowContextMenu(pSysTray); break; case WM_LBUTTONDBLCLK: + KillTimer(pSysTray->GetHWnd(), HOTPLUG_TIMER_ID); _RunHotplug(pSysTray); break; diff --git a/dll/shellext/stobject/power.cpp b/dll/shellext/stobject/power.cpp index 12382faf7d5..ada4fb1e812 100644 --- a/dll/shellext/stobject/power.cpp +++ b/dll/shellext/stobject/power.cpp @@ -374,19 +374,28 @@ HRESULT STDMETHODCALLTYPE Power_Message(_In_ CSysTray * pSysTray, UINT uMsg, WPA } return S_FALSE; + case WM_TIMER: + if (wParam == POWER_TIMER_ID) + { + KillTimer(pSysTray->GetHWnd(), POWER_TIMER_ID); + ShowPowerSchemesPopupMenu(pSysTray); + } + break; + case ID_ICON_POWER: Power_Update(pSysTray); switch (lParam) { case WM_LBUTTONDOWN: + SetTimer(pSysTray->GetHWnd(), POWER_TIMER_ID, 500, NULL); break; case WM_LBUTTONUP: - ShowPowerSchemesPopupMenu(pSysTray); break; case WM_LBUTTONDBLCLK: + KillTimer(pSysTray->GetHWnd(), POWER_TIMER_ID); _RunPower(); break; diff --git a/dll/shellext/stobject/volume.cpp b/dll/shellext/stobject/volume.cpp index a78bda743b6..ba0f9053563 100644 --- a/dll/shellext/stobject/volume.cpp +++ b/dll/shellext/stobject/volume.cpp @@ -214,10 +214,9 @@ HRESULT Volume_OnDeviceChange(_In_ CSysTray * pSysTray, WPARAM wParam, LPARAM lP return Volume_FindMixerControl(pSysTray); } -static void _RunVolume() +static void _RunVolume(BOOL bTray) { - // FIXME: ensure we are loading the right one - ShellExecuteW(NULL, NULL, L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL); + ShellExecuteW(NULL, NULL, bTray ? L"sndvol32.exe /t" : L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL); } static void _RunMMCpl() @@ -250,7 +249,7 @@ static void _ShowContextMenu(CSysTray * pSysTray) switch (id) { case IDS_VOL_OPEN: - _RunVolume(); + _RunVolume(FALSE); break; case IDS_VOL_ADJUST: _RunMMCpl(); @@ -285,6 +284,14 @@ HRESULT STDMETHODCALLTYPE Volume_Message(_In_ CSysTray * pSysTray, UINT uMsg, WP } return S_FALSE; + case WM_TIMER: + if (wParam == VOLUME_TIMER_ID) + { + KillTimer(pSysTray->GetHWnd(), VOLUME_TIMER_ID); + _RunVolume(TRUE); + } + break; + case ID_ICON_VOLUME: TRACE("Volume_Message uMsg=%d, w=%x, l=%x\n", uMsg, wParam, lParam); @@ -293,14 +300,15 @@ HRESULT STDMETHODCALLTYPE Volume_Message(_In_ CSysTray * pSysTray, UINT uMsg, WP switch (lParam) { case WM_LBUTTONDOWN: + SetTimer(pSysTray->GetHWnd(), VOLUME_TIMER_ID, 500, NULL); break; case WM_LBUTTONUP: - TRACE("TODO: display volume slider\n"); break; case WM_LBUTTONDBLCLK: - _RunVolume(); + KillTimer(pSysTray->GetHWnd(), VOLUME_TIMER_ID); + _RunVolume(FALSE); break; case WM_RBUTTONDOWN: