Link to home
Start Free TrialLog in
Avatar of Knarf
Knarf

asked on

System Tray Click and Double click

I would like to use both Click and Double click on my applications system tray icon.  I'm using the common Shell_NotifyIcon API to create the icon and Form_MouseMove to detect any mouse operations that accure.

The problem is that I'm unable to find a way to determan if a mouse event was a single click or a double click since there is no WM_LButtonClick constant.  If I check for LButtonDown or LButtonUp the events both accure with a double click aswell.

Is there anyway to know if the user clicked knowing it was not supposed to be a double click?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

No, both method are supported, here is the constant values you want:

Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_LBUTTONUP = &H202
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_RBUTTONUP = &H205

as more if you need help.
Avatar of kalihto
kalihto

ASKER CERTIFIED SOLUTION
Avatar of webJose
webJose

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Knarf

ASKER

Not a bad approach.  I actually did it a different way. I took the systems double click speed and I waited that long before executing the click command.  

If I double click was producted during the systems double click duration then the click event would not activate.

Its not exactly pretty but it works.