Basic and advanced methods for skinmagic

Source: Internet
Author: User
Basic and advanced methods used by skinmagic (reproduced)

1. How to Use skinmagic
1.1 initialize the skin control initskinmagiclib
Example: ninitskinmagiclib = initskinmagiclib (AfxGetInstanceHandle (), _ T ("LSA"), null, null); load the skin file loadskinfile (based on the file path) or loadskinfromresource (Based on the Resource Name ).
Example: nloadskinfile = loadskinfile (sskinfilepath );
1.2 use setdialoactivein, setsingledialoactivein, or setshapewindowskin to load skin on the form
The three are different.
1.3.1 setdialogskin is used to load the same skin to all forms. This function is not recommended. Unless your software uses the same skin.
1.3.2 setsingledialogskin loads skin on a single specified form. The window is displayed in the Rule form.
1.3.3 setshapewindowskin loads skin on a single specified form. The window is displayed in a non-Rule form.
2. Advanced methods used by skinmagic
2.1 removewindowskin remove skin from the specified form
This function can be used when a form or control does not require skin.
2.2 removedialogskin stops automatically loading skin to the form. It is mainly for setdialogskin.
2.3 enablewindowscrollbarskin loads the scroll bar skin on the specified form. Applicable to self-painted controls.
Example: nskin = enablewindowscrollbarskin (getdlgitem (idc_dlgtree_export)-> m_hwnd, sb_both );
2.4 disablewindowscrollbarskin causes the specified form to stop loading the scroll bar skin.
2.5 how to load skin on Splitter
2.5.1 custom splitter in skin files
2.5.2 enable Splitter
Example: m_hskin = openskindata (_ T ("skinsplitter "));
2.5.3 overload function ondrawsplitter
For details, see aw_cmultiviewsplitter in System Management source code.
2.6 how to obtain the image createbitmapfromskinimage from the skin file
Example: m_hbitmap = createbitmapfromskinimage (_ T ("listheader.bmp "));
2.7 when the same control type on a form has both self-Painting and skin Loading Methods
Create a new form in the skin file, such as frmwnd-D, and place the skin control on it. For example, a static control is called static-D. Example: nskin = setcontrolskin (getdlgitem (idc_static_main_title)-> m_hwnd, _ T ("static-d"), _ T ("frmwnd-d "));
Nskin = setcontrolskin (getdlgitem (idc_static_sub_title)-> m_hwnd, _ T ("static-d"), _ T ("frmwnd-d "));
2.8 solution when the self-painted control conflicts with the form for loading skin
The solution is to first load the skin of the form, and then create the Control Self-painting function.
The specific method is:
1. dodataexchange cancels the association between the self-painted control instance and the resource control ID
2. the user-drawn control instance after setsingledialogskin uses the subclassdlgitem method to associate with the resource control ID.
Example: Verify (1 = setsingledialogskin (this-> getsafehwnd (), _ T ("dialog ")));
M_list.subclassdlgitem (idc_list1, this );

Http://blog.csdn.net/lzyzuixin/archive/2009/02/06/3865676.aspx

Reference address: http://www.sciencenet.cn/m/user_content.aspx? Id = 287235

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.