zoukankan      html  css  js  c++  java
  • 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 = 1;
                DwmSetWindowAttributeEX(GetSafeHwnd(), 2, &dwAttr, 4); //去掉vista特效
            }
            FreeLibrary(hInst);
        }

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

    BOOL CMainFrame::OnNcActivate(BOOL bActive)
    {
        BOOL bRet = CWnd::OnNcActivate(bActive);
        SendMessage(WM_NCPAINT, 0, 0);
        Invalidate();
        return bRet;
    }
  • 相关阅读:
    STL map用法总结(multimap)
    Ice Cream Tower
    位运算 进制转化 STL中bitset用法
    《算法导论》插入排序
    C++输入/输出流
    kuangbin大佬模板(侵删)- hdu 2222
    poj 3461
    动态规划入门-01背包问题
    Dropping water balloons (入门dp)
    TSP
  • 原文地址:https://www.cnblogs.com/qintangtao/p/3281678.html
Copyright © 2011-2022 走看看