LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using creating balloon tips for tray icons

Solved!
Go to solution
Does anyone know if there is an easy way, perhaps a library I can use, to create balloon tips that I can use to pop up information next to my system tray icon?  Or is this something that I'll have to dive into the SDK to do?  Thanks in advance!
0 Kudos
Message 1 of 5
(4,436 Views)
0 Kudos
Message 2 of 5
(4,416 Views)

Sorry if I wasn't clear.  I don't think that InstallPopup() will do what I want, unless there is some other use of that function I'm not aware of.  See the attached image, as that's what I would like to do with my application.
balloon.PNG

Message Edited by tstanley on 12-28-2009 07:39 AM
0 Kudos
Message 3 of 5
(4,381 Views)
Solution
Accepted by topic author tstanley

Hey tstanley - 

 

CVI doesn't offer an API to create one of these balloon popups.  However, most other tray icon tasks can be accomplished with functions in the Programmers toolbox.  There is a great example that demonstrates these functions named Trayicon.  

 

To create the balloon popup you are talking about, you are either going to have to manage the tray icon API by yourself, or make some modifications to the toolbox.c source code, because some of the necessary manager functions are not exported.  Using this as a reference, I added a couple lines of code to toolbox.c (without any error checking for the sake of clarity) to display a very simple balloon popup.  Let me know if you have any questions.

 

int CVIFUNC ShowTrayIconBalloonPopup (int huser)
{
  BOOL sdkRetVal;
  SYS_TRAY_ICON *ptrayIcon;

  ptrayIcon = TrayMgrGetIconFromHandle (huser, NULL);
  ptrayIcon->nid.uFlags |= NIF_INFO;
  // szInfo is a 256 byte buffer
  snprintf (ptrayIcon->nid.szInfo, 256, "This is a test of a balloon popup.");  
  ptrayIcon->nid.uTimeout = 5000;
  S_Shell_NotifyIcon (NIM_MODIFY, &(ptrayIcon->nid), &sdkRetVal);

  return 0;
}

 

NickB

National Instruments 

Message 4 of 5
(4,374 Views)

Hi nickb,

Thanks for the help.  I haven't had a chance the past couple of days to play around with this, but your code works great.  I'll have to work on expanding upon it to get it to display my messages, but it looks like I have what I need to get started.  Thanks again!

0 Kudos
Message 5 of 5
(4,330 Views)