如图,
我想处理WM_NCPAINT,实现自绘窗口边框。就算把整个窗口填满,得到的窗口形状为什么不是矩形,而是上面有两个圆角。如果让win8系统来绘制窗口,为什么又是没有圆角的矩形窗口?
求高手指点
win7的窗口上面是有圆角的,win8没有。你看下就知道
switch (msg)
{
case WM_NCCREATE: {
// 修复窗口的圆角问题
auto uxtheme = LoadLibrary(L"uxtheme.dll");
if (uxtheme) {
typedef HRESULT(__stdcall* SetWindowTheme_t)(HWND, LPCWSTR, LPCWSTR);
auto SetWindowTheme = reinterpret_cast<SetWindowTheme_t>(GetProcAddress(uxtheme, "SetWindowTheme"));
SetWindowTheme(wnd, L"", L"");
FreeLibrary(uxtheme);
}
break;
}