View Single Post
Old 10-12-03, 07:48 PM   #1 (permalink)
compman
Aximsite Rookie
 
Join Date: Aug 2003
Posts: 48
Thanked 0 Times in 0 Posts
Notify Icon dosn't delete.

Ok, I have a bit of a problem. When I close my program on my PocketPC (and I mean compleately kill the process) the icon it placed on the taskbar is gone, but the space allocated for it still exists. So any subsequent taskbar icons that are made will be one (or more if you run the program again and again) space off. I send a Shell_NotifyIcon with NIM_DELETE set... no compiler errors or anything... anyone have any clue why it is not showing? Just to be straight, here's the code for both ways.

setting up the icon (in WM_CREATE):
Code:
		case WM_CREATE:
			g_hwndCB = CreateRpCommandBar(hWnd);
            // Initialize the shell activate info structure
            memset (&s_sai, 0, sizeof (s_sai));
            s_sai.cbSize = sizeof (s_sai);
			// Plug the taskbar icon down there.
			notify_ico.hWnd = hWnd;
			notify_ico.uFlags = NIF_ICON;
			notify_ico.hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_TASKBAR_CLEAR));
			notify_ico.cbSize = sizeof(NOTIFYICONDATA);
			notify_ico.uCallbackMessage = KLP_ICONACTIVATE;
			Shell_NotifyIcon(NIM_ADD, &notify_ico);
			break;
and in WM_DESTROY's corner:
Code:
		case WM_DESTROY:
			//destroy the Taskbar Icon
			Shell_NotifyIcon(NIM_DELETE, &notify_ico);

			CommandBar_Destroy(g_hwndCB);
			PostQuitMessage(0);
			break;
Sorry if this turns out to be an incredibly noobish question. I'm rather new at this... anyway, help is appreciated.:)

EDIT: gotta love webbrowsers, interpret ampersand and letters as something other than it should be.
__________________
-Compman

Last edited by compman; 10-12-03 at 07:51 PM.
compman is offline   Reply With Quote