Print Page | Close Window

Why assume my instance?

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=9468
Printed Date: 13 July 2025 at 2:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Why assume my instance?
Posted By: scruzer
Subject: Why assume my instance?
Date Posted: 01 February 2008 at 12:08am
On my first attempt to use the toolkit, I ran into a problem immediately.

I decided to use the CXTTrayIcon class.  Upon attempting to use the animation support -- I found that I must submit the icon's by ID. ONLY.

In my world, I make branded versions of my software.  All of my branded resources live in a dll.

I guess, I just want to say -- please don't write API's that always assume "this module" as the resource source....

Or provide a way to override such things without updating the source....  or... something easy.

Thanks
-p



Replies:
Posted By: Oleg
Date Posted: 01 February 2008 at 1:39am
Hi,
Here method you need:
CXTTrayIcon::SetIcon(HICON hIcon)


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


Posted By: scruzer
Date Posted: 01 February 2008 at 2:07am
So, like, how do I animate with a single HICON?


Posted By: Oleg
Date Posted: 01 February 2008 at 3:27pm
sorry, skipped "animation" word.
 
I see 2 solutions -
 
1. CXTTray load icons from hInstance = AfxGetResourceHandle(); so if you use your dll as primary resource call AfxSetResourceHandle(hYourDll); and CXTTray will load icons from dll.
 
or
 
2. make class derived from CXTTrayIcon and add icons to m_arTrayIcons collection. see sources.


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



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