I am using a win32 API
Code:
BOOL Shell_NotifyIcon(
DWORD dwMessage,
PNOTIFYICONDATA lpdata
);
I am creating the icon in WM_CREATE Message of my window procedure
Code:
static NOTIFYICONDATA ni;
WM_CREATE:
{
hIcon =(HICON) LoadImage( NULL, "pcclient.ico",IMAGE_ICON, 0, 0, LR_LOADFROMFILE) ;
(void) memset(&ni, 0, sizeof(ni));
ni.cbSize = sizeof(ni);
ni.uID = 106;
ni.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
ni.hIcon = hIcon;
ni.hWnd = hwnd;
strcpy(ni.szTip,"PC Client");
ni.uCallbackMessage = WM_APP ;
Shell_NotifyIcon( NIM_ADD , &ni);
return true;
}
WM_CLOSE:
{
Shell_NotifyIcon(NIM_DELETE, &ni);
return true;
}

