Load hcursor/hicon/hbitmap
Functions are provided in the system.
Loadcursor
Loadbitmap
Loadicon
1. The call method is generally:
Hcursor: loadcursor (afxgetapp ()-> m_hinstance, makeintresource (idc_cursor1 ));
Hicon: loadicon (afxgetapp ()-> m_hinstance, makeintresource (idi_icon1 ));
Hbitmap: loadbitmap (afxgetapp ()-> m_hinstance, makeintresource (idb_bitmap1 ));
2. You can also use afxgetapp for calling. The call method is relatively simple. We recommend that you use this method:
Hcursor: afxgetapp ()-> loadcursor (idc_cursor1 );
Hicon: afxgetapp ()-> loadicon (IDC _ icon1 );
Hbitmap: afxgetapp ()-> loadbitmap (idb_bitmap1 );
As shown above, the imported resources are attached to the current process cwinapp:
During import, the input instance is the current cwinapp instance or the default specified current winapp.
In addition
1. If makeintresource is used, the ID will be converted into a char * string. The loadxxx internal description is as follows:
Alternatively, this parameter can consist of the resource identifierin the low-order word and zero in the high-order word.
2. loadcursor, you can also load some default Mouse shape information of the system. For details, see the msdn help documentation.
MFC load hcursor/hicon/hbitmap