Building a dynamic link library project based on MFC [Skindll]
"Step1 Resource Import" imports a bitmap resource that has been edited, defines the identifier, and sets the project to compile for the MFC static Library
#define IDB_LEFTTITLE 1000
#define IDB_MIDTITLE 1001
#define IDB_RIGHTTITLE 1002
#define Idb_leftband 1003
#define Idb_bottomband 1004
#define Idb_rightband 1005
#define Idb_minbutton 1006
#define Idb_maxbutton 1007
#define Idb_closebutton 1008
#define Idb_minhotbutton 1009
#define Idb_maxhotbutton 1010
#define Idb_closehotbutton 1011
#define IDB_LEFTBOTTOM 1012
#define IDB_RIGHTBOTTOM 1013
#define Idb_background 1014
The "Step2 Cfomrpart class" Cfomrpart class is used to describe the bitmap resource used by each part of the window and the relative position
Class cformpart{
Pulic:
Hbitmap M_hbitmap;
CPoint M_pos;
};
The implementation of the "Step3 Cskin class" Cskin class for the principal function
The member variables of the class have
UINT M_partcount; Number of window module splits
cformpart* M_pparts; Cformpart class pointers for each window module
COLORREF M_menubkcolor; Menu background Color
COLORREF M_menuselcolor; Menu selection Color
BOOL Drawroud; Whether to draw rounded corners
void Loadbitmapres (); Loading bitmap Resources
void Setbuttonpos (); Set the position of the window button
CSkin (); The constructor is used to initialize the data and call Loadbitmapres () to load the bitmap resource Setbuttonpos () to set the button location
~cskin ()//destructor
Virtual Hbitmap getbitmapres (UINT Index); Gets the specified bitmap resource
Virtual CPoint getbuttonpos (UINT Index); Gets the specified button position
Virtual COLORREF getmenubkcolor (); Get Menu Background color
Virtual COLORREF getmenuselcolor (); Gets the color of the menu selection
To export a class in a dynamic connection library, if you want the method in that class to be accessed, the method must be defined as a virtual function to be exported for access
"STEP4 Export Cskin class in DEF file"
[00002]-[2015-06-27]-[00]-[MFC dynamic Link Library makes a dialog window skin (i)]