使用Aero主题时如何绘制对话框或应用程序的边框和标题? [英] How to draw the border and title of dialog or application when use Aero theme?

查看:92
本文介绍了使用Aero主题时如何绘制对话框或应用程序的边框和标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对不起我的英语不好.但这不能阻止我学习.

我想用位图绘制边框和标题.我的系统是Windows 7,并打开Aero主题.但是我发现我无法绘制边框或标题栏.而当我关闭Aero主题时,它会起作用.这是我的一些代码.我想知道,当打开Aero主题时如何使它工作?谢谢...

First, sorry for my poor English. But that can''t stop me learn.

I want to draw the border and title with a bitmap. My system is windows 7, and turn on Aero theme. But i found i cannot draw border or title bar. Whereas, when I turn off Aero theme, it works. Here are some of my code. I want to know, how can I make it work when turn on Aero theme? Thanks...

bmp.LoadBitmap(IDB_BITMAP7);
bmp.GetBitmap(&bmpInfo);

pOldBmp = dcMemory.SelectObject(&bmp);

x = bmpInfo.bmWidth;
y = bmpInfo.bmHeight;

lrBorderWidth = ( x > m_nFrameWidth+m_nBorderWidth ) ? x : m_nFrameWidth+m_nBorderWidth;

winDC.StretchBlt( 0,m_nCaptionHeight,lrBorderWidth,winRC.Height()-m_nCaptionHeight,&dcMemory,0,0,x,y,SRCCOPY );
winDC.StretchBlt( winRC.Width()-lrBorderWidth,m_nCaptionHeight,lrBorderWidth,
winRC.Height()-m_nCaptionHeight,&dcMemory,0,0,x,y,SRCCOPY);

dcMemory.SelectObject(pOldBmp);
bmp.DeleteObject();

推荐答案

您必须处理所有其他NC ..消息(WM_NCCALCSIZE,WM_NCPAINT,WM_NCHITTEST等).如何处理它们,请阅读SDK文档.为了防止圆角的Window布局,应将窗口区域设置为0(SetWindowRgn(0)).
问候.
You have to handle all the other NC.. messages (WM_NCCALCSIZE, WM_NCPAINT, WM_NCHITTEST and so on). How to handle them read the SDK documentation. To prevent the roundrect Window layout you should set the window region to 0 (SetWindowRgn(0)).
Regards.


这篇关于使用Aero主题时如何绘制对话框或应用程序的边框和标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆