CSkinManager

CSkinManager - Give your application a complete makeover!
A couple of years ago when WindowsBlinds was first released, I thought it would be nice to create my very own skinning engine. Unfortunately it turned out to be much more work than I expected. For example if you ever tried to subclass Windows scrollbars you can understand that it is not easy to get acceptable results.
Recently I decided to cleanup the code and make it available on this website. Maybe someone finds it usefull.
I’ve also created a simple SkinMaker to help you design your own Skins!

Supported controls:
- Static text
- Pushbutton
- Radiobutton
- Checkbox
- Groupbox
- Editbox
- Listbox
- Combobox
- Listview + Header Control
- Scrollbars
- Scrollbars in Editbox, Listbox, Combobox and Listview.

Dialog skinning:
- Caption including close, minimize and maximize buttons.
- Borders including transparency (shaped windows)
- Background image.

All other controls are not implemented, but it’s not very difficult to add them yourself once you understand how it all works.

The whole Skin Manager is implemented is just one class: CSkinManager.
CSkinManager has several nested classes that implement the behaviour of a specific control:
CSkinManager::CSkinButton implements button subclassing
CSkinManager::CSkinCheckBox implements checkbox subclassing
CSkinManager::CSkinDialog implements dialog subclassing.
etc

Using the Skin Manager is very easy:

Include SkinManager.cpp and SkinManager.h in your project.

To activate the skin manager call:
theSkinManager.InstallHook(LPCTSTR lpszFileName);

This installs a hook procedure that takes care of subclassing all controls and dialogs which are created.
lpszFileName specifies the skin definition file which holds the locations of the skin bitmaps.

To change to another skin at runtime call:
theSkinManager.LoadSkin(LPCTSTR lpszFileName);

Of course there is a lot more to write about this project since it took me several weeks to develop, but I think it’s better that you take a look at the demo and the source code to really understand what’s going on...


Download demo executable

Download source code
This class is part of the Pablo Software Solutions MFC Extension Package - Controls Edition


 

[Home] [Products] [Source Code] [Downloads]

© 2015 - Pablo Software Solutions
All rights reserved.