Within your created
WinMain
function the application main window is usually registered calling
RegisterClassEx
:
WNDCLASSEX wc;
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
RegisterClassEx(&wc);
HWND hwnd = CreateWindowEx(...);
IDI_APPLICATION
is the resource ID of an icon contained in the excutable file. That icon will be shown in the title bar of the window. You may change the ID to any icon ID that is present in the executable.
Each Windows executable contains embedded resources like icons, strings, dialog templates, cursors, version information. An IDE for Windows application creates a set of predefined IDs and provides the related resources.
With Visual Studio the resources are organised in resource source script files (
*.rc) and one or more header files with the ID definitions (
resource.h for project specific IDs). You can use the VS resource editor to modify these or edit the
rc files with a text editor.
I don't know how Dev-C++ handles resources but it should be in a similar manner (a quick research shows that it seems to use
rc script files too). You have to add an icon resource by providing an ID and the path to the icon file or edit the existing resource script file to change the path to your icon file.
See also
About Resource Files (Windows)[
^].