LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behaviour in trayicon example?

If I click beside the popup menu of a system tray icon, I expect the popup menu to disappear. This is however not the case in the trayicon example. Is there a way to correct this example?
0 Kudos
Message 1 of 4
(2,870 Views)
Hello

Is this example for LabVIEW, CVI or Measurement Studio? you failed to mention that.

A little more information would be nice.

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 4
(2,870 Views)
Sorry, CVI 6.0:
samples\toolbox\trayicon.prj
Run the example and make the menu appear by right-clicking on the icon. By left-clicking anywhere but the menu, the menu should disappear, but it doesn't.

I'm running NT4.

/Mattias
0 Kudos
Message 3 of 4
(2,870 Views)
I think I figure it out.

Since this is based from the SDK's (the source for the toolbox is in the toolslib), I think it bought to light a problem that is mentioned on the microsoft website.

PRB: Menus for Notification Icons Do Not Work Correctly
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q135788&

But basically, the way to solve it is to make the main panel active when bringing up the menu. so do the following:

case EVENT_RIGHT_CLICK:
SetActivePanel (g_panelHandle);
strcpy (eventName, "Right button down\n");
break;

This should make the menu behave correctly.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 4 of 4
(2,869 Views)