Print Page | Close Window

XTPImageManager

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=10029
Printed Date: 30 May 2024 at 8:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XTPImageManager
Posted By: jimmy
Subject: XTPImageManager
Date Posted: 01 April 2008 at 9:38am
Hi,

I use follow in OnInitDialog to set a dialog icon.

    XTPImageManager()->SetIcon(IDR_MAINFRAME, IDR_MAINFRAME);
    CXTPImageManagerIconSet *pIconSet = XTPImageManager()->GetIconSet(IDR_MAINFRAME);
    if (pIconSet)
    {
        CXTPImageManagerIcon *pIcon = pIconSet->GetIcon(32);
        if (pIcon)
            SetIcon(pIcon->GetIcon().GetIcon(), TRUE);

        pIcon = pIconSet->GetIcon(16);
        if (pIcon)
            SetIcon(pIcon->GetIcon().GetIcon(), FALSE);
    }

But pIcon->GetIcon().GetIcon() return 0.
Why ?

    Jimmy

I see that m_pRInfo is set.




Replies:
Posted By: Oleg
Date Posted: 01 April 2008 at 12:44pm
Hi,
Yes, ImageManager from 11.2.2 release stores all images in single bitmap to save GDI handlers.
 
Its kind of bad idea to use such method to set icon for main frame. Only Windows XP support Alpha icon in windows captions. Use standard AfxGetApp()->LoadIcon method.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Benit
Date Posted: 21 March 2011 at 7:18am
Hi ,
 
I have an issue related to SetIcon.
I was trying to set icon when while updating my browser frame.
BOOL bHighlight = IsKeyWordHighlighte();
if(bHighlight)
{XTPImageManager()->SetIcon ( IDI_ICON_HIGHLIGHTCLICK, ID_TBTBN_HIGHLIGHT ); }
else
{XTPmageManager()->SetIcon ( IDI_ICON_HIGHLIGHTNORMAL, ID_TBTBN_HIGHLIGHT ); }
 
this is crashing sometimes when i am trying to switch between windows.
Can u explain me the scenarios where seticon will fail



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