Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All

I am stuck at one point. I have made an application in which I want to show the progress status of a task in percentage in the tool-tip of its icon. How can I do this?

Below is the creation procedure of Icon:

C++
HINSTANCE hInstance = AfxGetResourceHandle();
CString strToolTipText = _T("This is a Tray Icon - Right click on me!");
// Create the tray icon
if (!TrayIcon.Create(hInstance,
     theApp.GetMainWnd()->GetSafeHwnd(), // Parent window
     WM_ICON_NOTIFY,                  // Icon notify message to use
     strToolTipText,  // tooltip
     ::LoadIcon(hInstance, (LPCTSTR)IDR_MAINFRAME),
     NULL)) 
return FALSE;


I want to update 'strToolTipText' runtime. Please suggest me something for this. I do this all in Application class. No dialog is in picture.

Thanks in advance
Posted

1 solution

you cant update it!!!

So delete the old tooltip and create a new.
 
Share this answer
 
Comments
Vaibhav_J_Jaiswal 4-Jun-14 7:57am    
Can you please suggest me, how shall I achieve this? Means how I merge tooltip and icon. In current scenario I am creating icon using NOTIFYICONDATA structure and whenever the mouse pointer is come on the icon the tooltip is updated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900