CDialogSK - A Skinnable Dialog Class
Introduction
This class is derived from the MFC CDialog
. It supports the following features :-
- If running on Windows 2000 or Windows XP, make any one color transparent so that you can see through regions of the dialog
- If running on Windows 2000 or Windows XP, make the whole dialog translucent
- Adding a bitmap to the back ground. The bitmap can be a resource, a BMP file, or a
HBITMAP
- Set style for background : Tile, Center, Stretch, resize dialog to the size of the bitmap
- Can enable/disable moving the dialog by clicking anywhere in it
Previous to Windows 2000 creating skinned dialogs were a bit difficult. You needed to write functions that could parse through the back ground image and create a CRgn
that defined the shape of the skin. This could be done using repetitive calls to CRgn::CombineRgn
for part of the image you wanted to see on the dialog. After creating the whole region you need to call CWnd::SetWindowRgn
with a handle to the combined CRgn
object.
From Windows 2000 a new API SetLayeredWindowAttributes
has been added to User32.dll. This class uses that to create skinned dialogs. However the background bitmap feature is not dependent on OS version and can be used on any version of Windows.
reference:http://www.codeproject.com/Articles/4509/CDialogSK-A-Skinnable-Dialog-Class
RFID管理系统集成商 RFID中间件 条码系统中间层 物联网软件集成