W
Auszug aus CTrayIcon.txt:
CTrayIcon(HINSTANCE hInstance, HWND hWnd, HICON hIcon, LPTSTR lpszTip)
CTrayIcon(HINSTANCE hInstance, HWND hWnd, WORD wIconID, LPTSTR lpszTip)
------------------------------------------------------------------------
Constructors. I think, the first parameter should be clear. In the second
you specify the window which will receive the Message WM_TRAYMESSAGE (see 2)
from the tray icon object. In addition, if a popupmenu is specified (using
CTrayIcon::SetPopupMenu), this window will receive all the messages coming
from this popup menu. The third parameter is a HICON handle to the icon, you'd
like to see in the tray. The last parameter is a pointer to a string that
consists of the tooltip text. This text is shown in a small window when you
place the mouse cursor over the icon in the tray.
The second constructor works as the first except in the third parameter. Here,
you can specify a resource ID for your icon.
CTrayIcon(HINSTANCE hInstance, WNDPROC WndProc, HICON hIcon, LPTSTR lpszTip)
CTrayIcon(HINSTANCE hInstance, WNDPROC WndProc, WORD wIconID, LPTSTR lpszTip)
------------------------------------------------------------------------
Other contructors. As you can see, everything is equal to the first two constructors,
except the second parameter. In this parameter you can specify a callback function
of type WNDPROC, i.e. LRESULT CALLBACK (HWND, UINT, WPARAM, LPARAM). If you create your
trayicon with this constructor, all the messages (WM_TRAYMESSAGE for mouse actions and
WM_COMMAND for menu clicks) are sent to the specified callback function.
Man bestaune noch folgende Funktion:
VOID ShowBalloon(LPTSTR szTitle, LPTSTR szInfo, UINT uiTimeout, DWORD dwIcon)
---------------------------------------------------------------------------------
With this function you can show a balloon (bubble) with some descripting text in it
right above your tray icon. The text which you specify in szTitle will be the header
of the text in the bubble and displayed in bold letters. Below, the text in szInfo
follows. The parameter uiTimeout is a time value (in milliseconds) specifying the
maximal display durance of the bubble. In dwIcon you specify a value which stands
for the icon that is displayed in the bubble. You have the following possibilities:
NIIF_NONE : No icon
NIIF_INFO : A bubble with a question mark
NIIF_WARNING : A warning yellow triangle with a "!" in it
NIIF_ERROR : A red error icon
NIIF_GUID : no idea what this is, sorry
NIIF_QUESTION : same as NIIF_INFO
NIIF_ICON_MASK : no idea what this is (it is reserved for future use, I think)
NIIF_NOSOUND : no sound is played (ONLY Shell Version 6)
NIIF_USER : ONLY SP2 - use the tray icon itself