// MyTaskBarDeleteIcon - deletes an icon from the taskbar status area. // Returns TRUE if successful, or FALSE otherwise. // hwnd - handle to the window that added the icon. // uID - identifier of the icon to delete. BOOL MyTaskBarDeleteIcon(HWND hwnd, UINT uID) { BOOL res; NOTIFYICONDATA tnid;
ModifyStyle(WS_SYSMENU, 0);
// Returns TRUE if successful, or FALSE otherwise.
// hwnd - handle to the window that added the icon.
// uID - identifier of the icon to delete.
BOOL MyTaskBarDeleteIcon(HWND hwnd, UINT uID)
{
BOOL res;
NOTIFYICONDATA tnid;
tnid.cbSize = sizeof(NOTIFYICONDATA);
tnid.hWnd = hwnd;
tnid.uID = uID;
res = Shell_NotifyIcon(NIM_DELETE, &tnid);
return res;
}