Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Dialog Icons

drgfthomas
Beginner
308 Views

I added a vanilla Dialog to an empty IVFconsole. This spawned *.rc, .h, and .fd. I've added or not the .fd or .h to the project. Even though the .rc has the default icon, it doesn't show up on the Dialogtitle bar nor does it become iconized when minimized to the task bar. How do I get it to do so?

0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
308 Views
The default icon is valid only for .exe's display in the Explorer. You have to attach it to the window manually, using APIs. Assuming you have both small and big version of IDI_MYICON, you have to place the following code into DLG_INIT callback:

hIcon = LoadImage(GetModuleHandle(0), IDI_MYICON, &
 IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR)
ret = SendMessage(Dlg%hWnd, WM_SETICON, ICON_SMALL, hIcon)
hIcon = LoadImage(GetModuleHandle(0), IDI_MYICON, &
 IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR)
ret = SendMessage(Dlg%hWnd, WM_SETICON, ICON_BIG, hIcon)

0 Kudos
drgfthomas
Beginner
308 Views
Excellent. Thanks a lot.
0 Kudos
Reply