The latest.
EMG
TTrayIcon [Solved]
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: TTrayIcon
Finally fixed!
This is the required change in Class TTrayIcon:
Now FWH\samples\TestTray.prg properly closes the Popup menu clicking outside it or pressing Esc
This explanation from the msdn gave us the solution:
This is the required change in Class TTrayIcon:
Code: Select all
METHOD Command( nWParam, nLParam ) CLASS TTrayIcon
...
case nLParam == WM_RBUTTONDOWN .and. ! Empty( ::bRClicked )
SetForegroundWindow( ::oWnd:hWnd )
Eval( ::bRClicked, a[ 1 ], a[ 2 ] )
...
This explanation from the msdn gave us the solution:
http://msdn.microsoft.com/en-us/library ... S.85).aspxTo display a context menu for a notification icon, the current window must be the foreground window before the application calls TrackPopupMenu or TrackPopupMenuEx. Otherwise, the menu will not disappear when the user clicks outside of the menu or the window that created the menu (if it is visible).
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact: