Original Post
🔒 Locked
Making A Window Minimize to Taskbar
Advertisement
The function is actually Shell_NotifyIcon
Oops, hehe.
Hadn't looked at it in a while: TaskBarAddIcon is a wrapper I wrote/ripped from somewhere else. Just for the record I've posted them below, cheers!
Zen
Hadn't looked at it in a while: TaskBarAddIcon is a wrapper I wrote/ripped from somewhere else. Just for the record I've posted them below, cheers!
Zen
// TaskBarAddIcon - adds an icon to the taskbar status area. // Returns TRUE if successful, or FALSE otherwise. // hwnd - handle to the window to receive callback messages. // uID - identifier of the icon. // hicon - handle to the icon to add. // lpszTip - tooltip text. BOOL TaskBarAddIcon(HWND hwnd, UINT uID, HICON hicon, LPSTR lpszTip) { BOOL res; NOTIFYICONDATA tnid; tnid.cbSize = sizeof(NOTIFYICONDATA); tnid.hWnd = hwnd; tnid.uID = uID; tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; tnid.uCallbackMessage = TB_NOTIFYICON; tnid.hIcon = hicon; if(lpszTip) lstrcpyn(tnid.szTip, lpszTip, sizeof(tnid.szTip)); else tnid.szTip[0] = '\0'; res = Shell_NotifyIcon(NIM_ADD, &tnid); if(hicon) DestroyIcon(hicon); return res; } // TaskBarDeleteIcon - 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 TaskBarDeleteIcon(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;}Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement