Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CDialog Task bar Icon Problem

33 views
Skip to first unread message

Shrishail Rana

unread,
Aug 19, 2003, 7:33:33 AM8/19/03
to
Hello

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


Shrishail Rana

unread,
Aug 19, 2003, 10:52:06 AM8/19/03
to

Tian Min Huang

unread,
Aug 20, 2003, 8:51:03 AM8/20/03
to
Hi Shrishail,

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.


Tian Min Huang

unread,
Aug 21, 2003, 1:15:31 PM8/21/03
to
Hi Shrishail,

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.

0 new messages