OS Windows XP, Windows 2000 and Windows ME.
Dev : VC6 SP5
I am using a dialog with styles Popup, No Border (no windows caption bar).
Everything goes fine but application does not show small icon on Windows
Taskbar button. It only shows the Window Title. Icon is shown when we do
alt-tab but small icon is not shown. If I set the style to have Caption Bar
on Dialog it shows the icon in Windows Task Bar Button.
I paint the caption on Onpaint
CPaintDC dc(this); // device context for painting
CRect rect;
GetClientRect(&rect);
if (IsIconic())
{
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
return;
}
////////custom painting follows on client area///
In OnInitDialog also I have done the
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
How can I get small icon to show on Windows Taskbar without using the
Caption Style. The same problem also exist on
With kindest regards
Shrishail Rana
Thanks for your post. I am checkingthis issue and will update you with my
information.
Have a nice day!
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! – www.microsoft.com/security
This posting is provided “as is” with no warranties and confers no rights.
It's by design that the window button is created without the icon in
Taskbar if an application does not contain a system menu, the window button
is created without the icon. To workaround this problem, we should use
ITaskbarList interface to add taskbar buttons manually. Please refer to the
following MSDN article for detailed information:
The Taskbar
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
Hope this helps.