dallaz
June 14th, 2002, 07:24 AM
I cant get my icon to turn up in my app.
I have a dialog based app and in OnInitDialog() I do the following:
NOTIFYICONDATA tnd;
tnd.cbSize = sizeof(NOTIFYICONDATA);
tnd.hWnd = this->GetSafeHwnd();
tnd.uID = 133;
tnd.uFlags = NIF_ICON;
tnd.uCallbackMessage = WM_ICONMESS;
tnd.hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
int res = Shell_NotifyIcon(NIM_ADD, &tnd);
When the dialog is shown, It covers the system tray so you can't see any icons, but when I hide the dialog, using:
ShowWindow(SW_MINIMIZE);
ShowWindow(SW_HIDE);
my icon isn't there!
BUT! When I click in the area where is should be, my dialog is shown again...
Someone knows what's wrong here?
Regards
/Johan
I have a dialog based app and in OnInitDialog() I do the following:
NOTIFYICONDATA tnd;
tnd.cbSize = sizeof(NOTIFYICONDATA);
tnd.hWnd = this->GetSafeHwnd();
tnd.uID = 133;
tnd.uFlags = NIF_ICON;
tnd.uCallbackMessage = WM_ICONMESS;
tnd.hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
int res = Shell_NotifyIcon(NIM_ADD, &tnd);
When the dialog is shown, It covers the system tray so you can't see any icons, but when I hide the dialog, using:
ShowWindow(SW_MINIMIZE);
ShowWindow(SW_HIDE);
my icon isn't there!
BUT! When I click in the area where is should be, my dialog is shown again...
Someone knows what's wrong here?
Regards
/Johan