Print Page | Close Window

Custom Icons

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=1368
Printed Date: 07 November 2025 at 9:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom Icons
Posted By: grudy
Subject: Custom Icons
Date Posted: 04 November 2004 at 10:22am

My application allows users to customize our toolbars and menus using a programming API - everything works great except I can't figure out how to allow them to change icons, and have them saved.

I can use XTPImageManager( )->SetIcons( ) to load a bitmap/icon that they specify and have it show up as the icon in the menu or toolbar, however when you exit, the new image is not saved in the registry. If I go thru customization and create an icon, that image is properly saved, however that uses XTPImageManager( )->AddCustomIcon( ) which is private (also sets m_nCustomIconId in CXTPControl, which is likewise not public)

Is there some way that I am missing to create the custom icon image programmatically at runtime, and get it saved.




Replies:
Posted By: Oleg
Date Posted: 05 November 2004 at 1:27am

In next release we added

void CXTPControl::AddCustomIcon(HICON hIcon)
{
 CXTPImageManager* pImageManager = GetImageManager();
 if (pImageManager)
 {
  m_nCustomIconId = pImageManager->AddCustomIcon(hIcon);
 }
}

and make CXTPImageManager::AddCustomIcon public.

 

so you can patch your sources too.



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


Posted By: Oleg
Date Posted: 05 November 2004 at 1:28am
better CXTPControl::SetCustomIcon

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


Posted By: grudy
Date Posted: 05 November 2004 at 8:50am
Thanks. That is just what I needed. It works great.


Posted By: Green
Date Posted: 12 February 2005 at 4:01am

Hi Oleg,
void CXTPImageManager::RemoveAll(void) doesn't reset m_nCustomID to its default state. Actually bug will never occurs. But it looks like defect, isn't it?




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