0

I am trying to create a BalloonToolTipIcon using VC++ in visual studio 2005. I am able to create a tooltip as shown in this image "http://www.c-sharpcorner.com/UploadFile/mahesh/tooltip-in-C-Sharp/Images/ToolTipImg2.jpg" but I am wishing it to be if this type "http://www.quantumsoftware.com.au/Images/Products/WindowsFormsComponents/BalloonToolTip.gif"...

I am using following code to create this tooltip. Can anyone tell me which property I am not setting properly?

NOTIFYICONDATA nidApp;
nidApp.cbSize = sizeof(NOTIFYICONDATA); // sizeof the struct in bytes
nidApp.hWnd = (HWND) hWnd;              //handle of the window which will process this app. messages
nidApp.uID = IDI_SYSTRAYDEMO;           //ID of the icon that willl appear in the system tray
nidApp.uFlags = NIF_INFO;
nidApp.hIcon = hMainIcon; // handle of the Icon to be displayed, obtained from LoadIcon
nidApp.uCallbackMessage = WM_USER_SHELLICON;
wcscpy_s(nidApp.szInfo, szinfo);
LoadString(hInstance, IDS_APPTOOLTIP,nidApp.szTip,MAX_LOADSTRING);
// Add the balloon tip
Shell_NotifyIcon(NIM_ADD, &nidApp);     //Show the systary icon

Thanks in advance

1 Answers1

0
  1. Did you call NIM_SETVERSION first? You should.
  2. The 'i' icon looks like dwInfoFlags=NIIF_INFO was set. This icon is placed left of szInfoTitle, so you should set that too. (I think you are, looking at the screenshot, but I don't see that in code).
MSalters
  • 173,980
  • 10
  • 155
  • 350
  • i dont know how to paste image so i am just showing you sample from internet images. –  Mar 18 '13 at 17:05
  • I am using following statement but it not giving me my desired output. Shell_NotifyIcon(NIM_SETVERSION, &nidApp); –  Mar 18 '13 at 17:09
  • @Arti: Read the [MSDN documentation](http://msdn.microsoft.com/en-us/library/windows/desktop/bb762159.aspx), in particular which fields you need to set. `NIM_SETVERSION` obviously needs a version number. – MSalters Mar 19 '13 at 07:42