Re: Tray icon almost works

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Paul G. Tobey [eMVP] (ptobey)
Date: 09/28/04


Date: Tue, 28 Sep 2004 08:29:48 -0700


"Minimized" and "tray icon" are *not* related unless you write your code to
make them that way. If, after you put the icon in the tray, you hide your
main window, that will be likely to give you the effect you are looking for.

Paul T.

"Pascal" <pascal.kock@freeler.nl> wrote in message
news:61a3ed11.0409272320.2246a52f@posting.google.com...
> Hello there,
>
> I have the following code to display a icon in the system tray on a
> WinCE4.1 device:
>
> void CZetesRF_IDDriverWinCE41Dlg::AddIconToTaskbar()
> {
> notifyData.hWnd = this->m_hWnd;
> notifyData.uFlags = NIF_MESSAGE | NIF_ICON;
> notifyData.uID = 1;
> notifyData.uCallbackMessage = WM_TRAYICONNOTIFY_MESSAGE;
> notifyData.szTip[0] =0;
> notifyData.cbSize = sizeof(notifyData);
>
> notifyData.hIcon = (HICON)LoadImage(AfxGetInstanceHandle(),
> MAKEINTRESOURCE
> (IDI_ICON3),IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
> Shell_NotifyIcon(NIM_ADD,&notifyData);
> }
>
> I can see the icon in my system tray but my application is not
> minimized. How do I achieve this ??
>
> Greetings,
>
> Pascal



Relevant Pages