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 o...

Introduction

This class is derived from the MFC CDialog. It supports the following features :-

  1. If running on Windows 2000 or Windows XP, make any one color transparent so that you can see through regions of the dialog
  2. If running on Windows 2000 or Windows XP, make the whole dialog translucent
  3. Adding a bitmap to the back ground. The bitmap can be a resource, a BMP file, or a HBITMAP
  4. Set style for background : Tile, Center, Stretch, resize dialog to the size of the bitmap
  5. 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

目录
相关文章
|
3天前
Dialog从0到1
Dialog从0到1
25 0
|
6月前
Class下的getEnumConstants
Class下的getEnumConstants
41 0
DHL
|
JSON 安全 算法
value class 完全代替 typealias?
这篇文章将会从 类型安全 、 占用内存 、执行效率 、使用场景 这几个角度来分析 value class ,通过这篇文章,你将学习到以下内容。
DHL
177 0
value class 完全代替 typealias?
Dialog显示引起的问题 Activity has leaked window DecorView@5704632[] that was originally added here
Dialog显示引起的问题 Activity has leaked window DecorView@5704632[] that was originally added here
|
Apache
class7
搭建lamp
163 0
class4
安装putty工具远程连接ECS服务器
166 0
|
数据安全/隐私保护 Android开发
Dialog的使用
概述 Dialog是Android的提示框,虽然说是很基础的东西,但是里面其实还有很多值得学习交流的地方。本文将从以下三个方面学习Dialog:      1.
1191 0