- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear,
I see my custom Icon next to the name of my program but when the application is running, I neither see it in the upper-left corner of the main program window nor in the other windows.
What is the Fortran statement to use the Identifier coresponding to a custom Icon, for example IDI_iconappname, to show the Icon in an upper-left window of a program?
Sincerly Yours,
Olivier
I see my custom Icon next to the name of my program but when the application is running, I neither see it in the upper-left corner of the main program window nor in the other windows.
What is the Fortran statement to use the Identifier coresponding to a custom Icon, for example IDI_iconappname, to show the Icon in an upper-left window of a program?
Sincerly Yours,
Olivier
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For display in Explorer and shell, Windows automatically scans your .exe for icons and picks up the first one (by numeric order of icon ID).
To display the icon in the window's top-left corner, you have to use the Windows API functions:
[fortran]use DFWIN include "resource.fd" ... integer(HANDLE):: hIcon integer(HANDLE):: hWnd ... hIcon = LoadIcon(GetModuleHandle(0), IDI_MYICON) ret = SendMessage(hWnd, WM_SETICON, ICON_SMALL, hIcon) [/fortran]where IDI_MYICON is the identifier of the icon as you typed it in resource editor, and hWnd is handle of your main application window. If your application is QuickWin one, you can retrieve that handle using GETHWNDQQ(QWIN$FRAMEWINDOW).

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page