WIN7或者WIN8上边框的异常问题的解决攻略

//主要两个步骤:
//第一个步骤就是在CMainFrame::OnCreate里面增加

  HINSTANCE hInst = LoadLibrary(_T("UxTheme.dll"));
if (hInst)
{
typedef HRESULT (WINAPI *PFUN_SetWindowTheme)(HWND, LPCTSTR, LPCTSTR);
PFUN_SetWindowTheme pFun = (PFUN_SetWindowTheme)GetProcAddress(hInst, "SetWindowTheme");
if (pFun)
{
pFun(m_hWnd, _T(""), _T("")); //去掉xp主体
}
FreeLibrary(hInst);
} hInst = LoadLibrary(_T("dwmapi.dll"));
if (hInst)
{
typedef HRESULT (WINAPI * TmpFun)(HWND,DWORD,LPCVOID,DWORD);
TmpFun DwmSetWindowAttributeEX = (TmpFun)::GetProcAddress(hInst, "DwmSetWindowAttribute");
if (DwmSetWindowAttributeEX)
{
DWORD dwAttr = ;
DwmSetWindowAttributeEX(GetSafeHwnd(), , &dwAttr, ); //去掉vista特效
}
FreeLibrary(hInst);
}

//然后就是添加WM_NCACTIVATE添加消息响应函数:

BOOL CMainFrame::OnNcActivate(BOOL bActive)
{
BOOL bRet = CWnd::OnNcActivate(bActive);
SendMessage(WM_NCPAINT, , );
Invalidate();
return bRet;
}
上一篇:GPU高性能计算-CUDA


下一篇:js中数组的操作方法