window instances that support skin-changing functions

Source: Internet
Author: User

This example shows how to draw a custom (custom-drawn) window frame (including headings, borders, and so on).

First, the preface

Today, software that supports custom skin features is becoming more popular. This allows users to modify the appearance of the program themselves. Even the Windows operating system itself did this. The theme (theme) technology provided by Windows XP can modify the appearance of Windows, buttons, scrollbars, and so on.

Recently, I want to use MFC to design a skin-changing program. I didn't search for anything I wanted on the internet, so I decided to write one myself. This is not a difficult problem, but it needs to be familiar with the mechanism of the Windows operating system's drawing window.

Second, background

I have provided some of the following classes:

1. The Cskinwin----Cskinwin class is a class that draws custom (custom-painted) Windows. It draws the top, bottom, left, right, and title bar buttons such as Maximize, close buttons. To do this, the Cskinwin class reads the configuration information from an INI file, configuring the bitmap for each border in the INI file. It should be noted that the format of the INI file is copied from the UIs format of Windows blinds (Stardock's masterpiece), because I want to support the topic of Windows Blinds in my program.

2. Cskinbutton---Cskinbutton class is a class that draws custom (custom) buttons. It represents a normal, focused, pressed, and invalid state with four bitmaps respectively. Bitmap format is also a Windows blinds format, and parameters are defined in the same INI file. Because a window has more than one button instance, I designed the Cskinbuttonresource class to store the skin of the custom (self-painting) button.

3. Cmybimtap---Some related classes, some of which are from CodeProject. Although I do not remember these authors, I would like to thank them.

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.