Pelles C forum

C language => Windows questions => Topic started by: Frank on August 10, 2012, 08:25:11 AM

Title: Resource editor bitmap and icon resource
Post by: Frank on August 10, 2012, 08:25:11 AM
Resource-Editor: Is it possible to set a bitmap- or icon resource in a dialog with a character-string? The style-optinon with an numeric value (e.g. #8000) is possible, but not with a character (e.g. "Icon_New" .or. "Bmp_New").
Title: Re: Resource editor bitmap and icon resource
Post by: CommonTater on August 10, 2012, 02:37:26 PM
Yep, I do it all the time.  Bitmaps, Icons, Dialogs, etc. 

Download any of my AddIns and you'll see how it's done in the source code...

For example: http://forum.pellesc.de/index.php?topic=4481.msg16774#msg16774 (http://forum.pellesc.de/index.php?topic=4481.msg16774#msg16774)

To do this with, for example a dialog...
 
1) Go into your resources editor
2) Right click and select new -> dialog
3) Now right click the new dialog and select properties
4) Give it a name such as "MYDIALOG" in quotes.
5) Click OK...
6) Double click to edit your new dialog.
 
You can also close the graphic editor and right click on your resource file in the project panel and select "open as text" and do it manually. You will find a line something like...
 
#4000 DIALOGEX DISCARDABLE 6, 18, 261, 172
 
Simply re-edit it to...
 
SETUP DIALOGEX DISCARDABLE 6, 18, 261, 172
 
But... and this is the trick...
You may also have to edit the resource.h file POIDE spits out to eliminate conflicts with your renamed resources.  (Personally I just delete it.)
 
 
Title: Re: Resource editor bitmap and icon resource
Post by: Frank on August 11, 2012, 02:02:13 PM
But Thank you for your reply. But that's not what I mean. When I insert a bitmap-style or an icon-style within a dialog, so only bitmaps and icon with numerical values are displayed in the properties-selection.
Title: Re: Resource editor bitmap and icon resource
Post by: CommonTater on August 11, 2012, 02:39:40 PM
But Thank you for your reply. But that's not what I mean. When I insert a bitmap-style or an icon-style within a dialog, so only bitmaps and icon with numerical values are displayed in the properties-selection.

OOPs my bad....  If you mean a picture control, yes, that has to be numeric, selected from the dropdown list in the properties panel.