Adds, modifies, or deletes an icon in the specified notification area.
BOOL Shell_NotifyIcon(
DWORD dwMessage,
PNOTIFYICONDATA pnid
);
NIM_ADD: Add an icon to the notification area.NIM_MODIFY: Modify an existing icon in the notification area.NIM_DELETE: Delete an icon from the notification area.NIM_SETFOCUS: (Windows Vista and later) Sets the focus to the notification area.NIM_IMPLICIT_UPGRADE: (Windows 7 and later) Indicates that the notification icon has been implicitly upgraded to a notification in the Action Center.NOTIFYICONDATA structure that contains information about the icon and the callback information.
TRUE if successful, or FALSE otherwise.
NOTIFYICONDATA structure must be fully initialized before being passed to this function.cbSize member of the NOTIFYICONDATA structure must be set to the size of the structure in bytes.uID member of the NOTIFYICONDATA structure specifies a unique identifier for the icon.uFlags member of the NOTIFYICONDATA structure specifies which members of the structure are valid.NIM_ADD or NIM_MODIFY, the hIcon member of the NOTIFYICONDATA structure must contain a handle to the icon to be displayed.NIM_DELETE, only the cbSize, hWnd, and uID members of the NOTIFYICONDATA structure need to be valid.Contains information used by the notification area to display and manage notification icons.
typedef struct tagNOTIFYICONDATA {
DWORD cbSize;
HWND hWnd;
UINT uID;
UINT uFlags;
UINT uCallbackMessage;
HICON hIcon;
TCHAR szTip[128];
DWORD dwState;
DWORD dwStateMask;
TCHAR szInfo[256];
UINT uTimeout;
TCHAR szInfoTitle[64];
DWORD dwInfoFlags;
GUID guidItem;
HICON hBalloonIcon;
} NOTIFYICONDATA, *LPNOTIFYICONDATA;