[STOBJECT] Use timers to distinguish between single and double clicks

- Volume, Power and Hotplug icon: Use timers to distinguish between single and double clicks.
- Volume icon: Show the tray volume dialog on a single click.
This commit is contained in:
Eric Kohl 2018-02-28 20:29:29 +01:00
parent b95fff5bce
commit 2baafa61c6
4 changed files with 39 additions and 9 deletions

View file

@ -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;