必备要求:
1. Vista 及以上操作系统。
2. VS SP1 及以上编译环境。
导入下列文件:
#include<dwmapi.h>
#pragma comment(lib,"dwmapi.lib")
对话框的基类要选择 CDialogEx,而不是 CDialog。
在 OnInitDialog() 中添加下列代码:
BOOLbDwm;
DwmIsCompositionEnabled(&bDwm);
if(bDwm)
{
MARGINSmrg= {-1};
DwmExtendFrameIntoClientArea(m_hWnd, &mrg);
SetBackgroundColor(RGB(0, 0, 0));
}
效果图:
原文:/polytechnic/article/details/5696797