Create a dialog box project with VC.
1. After # include <afxdisp. h> In stdafx. H, add the followingCode:
# Import "actskn43.ocx" no_implementation raw_interfaces_only raw_native_types
Using namespace activeskinlib;
# Include <atlbase. h>
2. Switch to resource view, right-click on the dialog box, click "insert ActiveX control", select activeskin 4.3 Control, and edit its ID.
3. In xxxdlg. H, add the member variable ccomqiptr <iskin> m_pskin to the class in the dialog box;
4. In xxxdlg. cpp, write the following code in the oninitdialog () function:
// Use the skin ID here
M_pskin = getdlgitem (idc_skin_play)-> getcontrolunknown ();
M_pskin-> applyskin (INT) m_hwnd );
Char chdirectory [500];
Getmodulefilename (null, (lpwch) chdirectory, 500 );
Cstring strpath (chdirectory );
// Set the path
Strpath = "./skin/untitled. skn ";
BSTR bstrskinfile = strpath. allocsysstring ();
// Load skin
M_pskin-> loadskin (bstrskinfile );
// Application skin here, the Control ID (idc_button_play) and the Object Name (BTN) of the skin are used)
M_pskin-> applyskinbyname (long) getdlgitem (idc_button_play)-> m_hwnd, l "btn1 ");
RunProgramThe control has a skin effect!