Dialog control icon

How do you make a dialog control icon?

This is what I have:

1
2
3
4
5
#define IDI_ICON 1001
/**/
IDI_ICON ICON "icon.ico"
/**/
ICON "IDI_ICON", 1001, 48, 48, SS_ICON


That give the error:
RC2108 : expected numerical dialog constant


I'm using MSVC++ 2008 Express Edition

Thanks!
Are you trying to write a *.rc file??

The line:
ICON "IDI_ICON", 1001, 48, 48, SS_ICON should be enclosed within a DIALOGEX statement - as it denotes an ICON control as apposed to the resource itself
Yes, I have it in a DIALOGEX statement. I managed to get all the other controls to work, but not the ICON one.
Aaah, It might be the number of parameters you are providing

Try adding a width and height parameter (I have used 32 for width and height here, but you can use 0 because windows always use the real icon width and height)

ICON "IDI_ICON", 1001, 48, 48, 32,32, SS_ICON


Also If that compiles without error, but the icon doesn't show, then try (without the quotation marks)
ICON IDI_ICON, 1001, 48, 48, 32,32, SS_ICON
Yep, that was it, the correct version is ICON IDI_ICON, 1001, 10, 10, 32, 32, SS_ICON and SS_ICON is optional, however, unlike MSDN documentation says, the width and height are not.
Topic archived. No new replies allowed.