Print Page | Close Window

ImageManager Icon Handle

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23225
Printed Date: 27 November 2024 at 1:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ImageManager Icon Handle
Posted By: ScottW
Subject: ImageManager Icon Handle
Date Posted: 10 December 2016 at 4:36pm
I'm trying to use ImageManager icons at runtime to set the MDI Child Form and Workspace Tab Icons. Using Form.Icon always looks terrible, but this works and looks great:

hBitmap = LoadImageAsString(0, "somefile.ico", IMAGE_ICON, 16, 16, LR_LOADFROMFILE)
SendMessageLong Me.hWnd, WM_SETICON, ICON_SMALL, hBitmap

The problem is that I'm not distributing all of the individual icons with my app. Just one binary file with all of the icons in ImageManager format. Once I have that loaded, how can I get an Icon handle for any given ImageManager Icon that is compatible with WM_SETICON?

This doesn't seem to work:
hBitmap = ImageManagerIcons.GetImage(ICON_ID, 16).Handle
SendMessageLong Me.hWnd, WM_SETICON, ICON_SMALL, hBitmap

Is there some other way to do this?

Thanks




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