Seth77
Messages postés572Date d'inscriptionmardi 30 avril 2002StatutMembreDernière intervention 4 mai 2020
-
20 févr. 2005 à 13:27
rvblog
Messages postés792Date d'inscriptionvendredi 4 mars 2005StatutMembreDernière intervention12 juin 2012
-
14 mars 2006 à 11:40
Slu
J ai mis pour mon app un icone dans le tray.
Et lorsque je clix avec le bouton droit je fais apparaitre un menu.
Mais le menu disparait tres difficlement meme en cliquant sur le bureau ou sur la barre des taches.
rvblog
Messages postés792Date d'inscriptionvendredi 4 mars 2005StatutMembreDernière intervention12 juin 20127 14 mars 2006 à 11:40
PRB: Menus for Notification Icons Don't Work Correctly
Last reviewed: September 20, 1996
Article ID: Q135788 ,
----
The information in this article applies to:
<LI>Microsoft Win32 Application Programming Interface (API) included with:
- Microsoft Windows 95 version 4.0
</LI>
SYMPTOMS
When you display a context menu for a Notify Icon (see Shell_NotifyIcon), clicking anywhere besides the menu or the window that created the menu (if it is visible) doesn't cause the menu to disappear. When this behavior is corrected, the second time this menu is displayed, it displays and then immediately disappears.
RESOLUTION
To correct the first behavior, you need to make the current window the foreground window before calling TrackPopupMenu or TrackPopupMenuEx.
The second problem is caused by a problem with TrackPopupMenu. It is necessary to force a task switch to the application that called TrackPopupMenu at some time in the near future. This can be accomplished by posting a benign message to the window or thread.
The following code will take care of all of this:
SetForegroundWindow(hDlg);
// Display the menu
TrackPopupMenu( hSubMenu,
TPM_RIGHTBUTTON,
pt.x,
pt.y,
0,
hDlg,
NULL);
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.