|
-
April 9th, 1999, 02:46 PM
#1
System Tray Icon Question
I have added the icon to the system tray, but how can I tell if the user right clicks on the icon? How about if they left click it?
Thanks,
Nathan Standberg
-
April 9th, 1999, 03:55 PM
#2
Re: System Tray Icon Question
Hi Nathan.
When creating the tray icon you can specify a callback message that will be send
to your window when the user clicks (or whatever) on your icon.
See: NOTIFYICONDATA m_nid;
m_nid.cbSize = sizeof(m_nid);
m_nid.hWnd = this->m_hWnd;
m_nid.uID = 1;
m_nid.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE;
m_nid.uCallbackMessage = WM_TASKBAR; // <--- The message
strTip.LoadString(IDS_TIP);
strcpy(m_nid.szTip, strTip);
m_nid.hIcon = m_hIcon = AfxGetApp()->LoadIcon(IDI_ACTIVE);
All you've got to do now is catch the message and react in a proper way:
Hope this helps
Regards Ronny
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|