Print Page | Close Window

CXTCaption::UpdateCaption icon bug

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1592
Printed Date: 22 February 2025 at 8:46am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTCaption::UpdateCaption icon bug
Posted By: Kimeli
Subject: CXTCaption::UpdateCaption icon bug
Date Posted: 28 December 2004 at 4:00am
I noticed a tiny bug in CXTCaption::UpdateCaption.
Bug occurs when changing icon from "real icon" to "null icon".

In CXTCaption::UpdateCaption are following code:

    if (hIcon != NULL)
    {
        m_hIcon    = hIcon;
        DrawCaptionIcon( pDC, rcClient );
    }

So if given icon is NULL, then CXTCaption::m_hIcon wont be updated and
previous icon will be painted when next update occurs (UpdateCaption seems
to work ok before next paint, because it erases background in UpdateCaption also).

Luckily, UpdateCaption is virtual, so it can be override. But that
if (hIcon != NULL) should be removed, set m_hIcon outside of
that scope, etc..

[offtopic]
Happy new year!
[/offtopic]





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net