CDialogSK - A Skinnable Dialog Class

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

时间: 2024-09-11 13:51:49

CDialogSK - A Skinnable Dialog Class的相关文章

Devexpress VCL Build v2013 vol 13.2.2 发布

devexpress 2013 的第二个大版本出来了,一如既往, 基本上还是一个大补丁包.各位看官,自己看.   What's New in 13.2.2 (VCL Product Line)   New Major Features in 13.2 What's New in VCL Products 13.2 Breaking Changes To learn about breaking changes in this version, please refer to the follow

Android使用Activity用作弹出式对话框Dialog

转载请表明出处:http://blog.csdn.net/lmj623565791/article/details/23116115 Android中可用于实现对话框的有Dialog,PopupWindow,Activity. 下面简单介绍下,Dialog比较方便,但是显示位置比较固定,有时不能满足我们的需求. 例子:(消除了背景) [html] view plaincopy <resources>       <style name="dialog" parent=

dialog-重写一个 Dialog 的 onBackPressed 方法

问题描述 重写一个 Dialog 的 onBackPressed 方法 如何重写一个 Dialog 的 onBackPressed 方法来关闭对话框,同时调用 Activity 中的finish()方法? 解决方案 你可以使用 setOnCancelListener: dialog.setOnCancelListener(new DialogInterface.OnCancelListener listener() { @Override void onCancel(DialogInterfac

QT中Dialog的使用

先看看效果图:   pages.h #ifndef PAGES_H #define PAGES_H #include <QWidget> class ConfigurationPage : public QWidget { public: ConfigurationPage(QWidget *parent = 0); }; class QueryPage : public QWidget { public: QueryPage(QWidget *parent = 0); }; class Up

Android中自定义Activity和Dialog的位置大小背景和透明度等

1.自定义Activity显示样式 先在res/values下建colors.xml文件,写入: [xhtml] view plaincopy <?xml version="1.0" encoding="utf-8"?>   <resources>       <!-- 设置透明度为56%(9/16)左右 -->       <color name="transparent">#9000</c

VC中设置Dialog背景图象

在CODEGURU看到一个MDI CLIENT以位图为背景的例子,受到启发,在DIALOG中相似地模仿了以下,效果很好. 主要要点是处理背景擦除消息时在DIALOG CLIENT区域画位图,代码如下: BOOL CBmpbgDlg::OnEraseBkgnd(CDC* pDC){CRect rect;GetClientRect(&rect);BITMAP bm;CDC dcMem;m_pBmp->GetObject(sizeof(BITMAP),(LPVOID)&bm);dcMem.

dialog工具中,访问用户输入的结果为什么要重定向&amp;amp;quot;标准错误流&amp;amp;quot;?而不是“标准输出流”?

问题描述 dialog工具中,访问用户输入的结果为什么要重定向"标准错误流"?而不是"标准输出流"? 标题限制,完整问题为------dialog工具中,对于文本输入,访问用户输入的结果为什么要重定向"标准错误流"?而不是"标准输出流"? 看Neil Matthew著的<Linux程序设计>65页中关于dialog访问用户输入结果的一点思考,想知道其中的一些机制.小白求助亲们解答一些,谢谢. 解决方案 iunx 下

安卓-fragment中额外加入时间选择器dialog的布局

问题描述 fragment中额外加入时间选择器dialog的布局 public class ReleaseFragment extends Fragment implements View.OnTouchListener{ private EditText etStartTime; public ReleaseFragment() { // TODO Auto-generated constructor stub}@Overridepublic View onCreateView(LayoutI

jQuery Mobile教程:dialog组件close的api

文章简介:本文主要看一下jQuery Mobile体系中的dialog组件. 本文主要看一下jQuery Mobile体系中的dialog组件: 它开放了一个close的api 1.如何关闭dialog? 示例: //关闭dialog $("#close-dialog-btn").click(function(){ $("#alert-dialog").dialog("close"); }); 源码: //#4114 close:function