|
|
TaskBarIcon.hThis TaskBarIcon class wraps the Shell Task Bar and allows you to install a task bar icon for your own windows.To add a task bar icon to your application, add a member variable to your window...
Then in the OnInitDialog() event handler, initialise the icon:
You now need to define the resource IDR_TASKBAR. Create a
string resource for the tooltip, an icon resource for
the icon image and a menu for the popup. Make sure to use the
symbolic name IDR_TASKBAR for all of them.
Then chain the class to the message map for default handling.
The Shell Task Bar API defines a few notifications when things happen over
your new icon. For compatibility reasons, you should use the
WM_LBUTTONDOWN and WM_RBUTTONDOWN events with
the new TASKBAR_MESSAGE_HANDLER message map macro.
When you use a Task Bar icon it doesn't necessarily mean that your window
will minimize to the taskbar. This is additional functionality you must add
yourself.
Call ShowWindow(SW_SHOWNORMAL) to show the window again when someone clicks
on the icon.
Source Code DependenciesMicrosoft WTL 3.0 LibrarySee AlsoA WTL sampleDownload Files
Written by Bjarke Viksoe. Article submitted 6/7/2001.
|
|||