Today, let's take a look at how to modify the application icon (small icon. The small icon is the icon shown by the arrow and in the red box ,:)
Below is the System icon of the window. Click the system operation menu for this window to pop up:
The following is the icon of the executable file of the application, which is slightly larger:
Let's take a look at how to modify them, which is the content of instance 7-step007-icon. Here, we can also see how to modify the system icon of the window, or System icon for short.
What we need to know is actually two macros:
-
Winx_app_icon
-
Winx_sysicon
Winx_app_icon
Usage: winx_app_icon (hinstance, idi_search );
Idi_search specifies the ID of the icon in the Application resource, while hinstance specifies the application resource to be selected.
Note: There is a semicolon!
Using the winx_app_icon macro, we can specify all the icons related to the application, such as the system icons of all the windows of the application (including the dialog box, message box, and general window) (in the upper left corner of the window ), the icon of the executable file of the application.
Because the hinstance parameter is required for the winx_app_icon macro, this macro is generally placed in winmain to specify the entire application-related icon.
Winx_sysicon
Usage: winx_sysicon (idi_information );
Idi_information is used to specify the resource ID of the System icon and application icon.
As the name suggests, the System icon of the window specified by the winx_sysicon user. That is to say, if you want to change the default system icon of the window, you need to define the winx_sysicon Macro when defining this window class (not wndclass.
Today's Practice
We only need to modify the appicon program in the step007-icon of this instance 7, you can understand the difference:
Class chellodlg: Public winx: modaldialog <chellodlg, idd_hello>
{
Winx_sysicon (idi_information );
};
The execution result after compilation is as follows:
<End>