Icons in dialogs...
If I have a resource editor created dialog in VC++, is it possible to compile it and choose which icon will be shown for the exe?
I know this can be done by creating the window by making the window class.. registering and showing.. but I'm too damn lazy to type in all the coords for the CreateWindowEx()'s and stuff.. heh.
Thanks for any help.
>>If I have a resource editor created dialog in VC++, is it possible to compile it and choose which icon will be shown for the exe?<<
Not 'automatically' for dialog resources. Use this instead (can be used with normal windows too):
where hwnd is the handle of your dialog/window, nIconType is one of two values (ICON_BIG or ICON_SMALL) and hIcon is the handle of the icon retrieved, preferably as the return value of a succesful call to 'LoadImage', but LoadIcon will do. For clarification read up on WM_SETICON in msdn.
SendMessage(hwnd, WM_SETICON, nIconType, (LPARAM) hIcon);
Worked like a charm, thanks!