PRB: Application Icon Does Not Appear on Taskbar Button (190983)
The information in this article applies to:
- Microsoft Windows CE 2.0 for the Handheld PC
- Microsoft Windows CE 2.1 for the Handheld PC
- Microsoft Windows CE 2.11 for the Handheld PC
- Microsoft Windows CE 2.12 for the Handheld PC
- Microsoft Windows CE 3.01 for the Handheld PC
- Microsoft Windows CE 3.0 for the Handheld PC
- Microsoft Windows CE 3.0 Professional Edition for the Handheld PC
This article was previously published under Q190983 SYMPTOMS
When you create a top-level window, a button is displayed on the taskbar
with the window's title. However, the window's icon is not displayed, even
when a valid icon handle is provided when you register the window class.
CAUSE
Windows CE stores handles to both the large icon and small icon in the
window's internal class information. When the class is initially
registered, the small icon handle is set to NULL and the large icon handle
is set to the handle provided in the hIcon member of the WNDCLASS
structure. Windows CE uses the small icon when displaying a button in the
taskbar.
RESOLUTION
To set the small icon for a window, your application should send a
WM_SETICON message to its window as follows:
#define ICON_SMALL 0
HICON hSmallIcon = LoadImage (hInstance,
MAKEINTRESOURCE (IDI_APPICON),
IMAGE_ICON,
GetSystemMetrics (SM_CXSMICON),
GetSystemMetrics (SM_CYSMICON),
LR_DEFAULTCOLOR);
.
.
LRESULT WINAPI WndProc (HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_CREATE:
SendMessage (hWnd, WM_SETICON, (WPARAM)ICON_SMALL,
(LPARAM) hSmallIcon);
return 0;
case WM_SETICON:
return DefWindowProc (hWnd, uMsg, wParam, lParam);
.
.
}
return 0;
}
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 3/16/2004 |
---|
Keywords: | kbIcon kbprb KB190983 |
---|
|