• vista、win7厚边框问题解决办法


        int CDBFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
        {
            if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
                return -1;
       
            ModifyStyle(WS_CAPTION, 0);    //没有这行,最大化的时候有窗口边缘8像素的被截掉了
       
            HINSTANCE hInst = LoadLibrary(_T("UxTheme.dll"));
            if (hInst)
            {
                typedef HRESULT (WINAPI *PFUN_SetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
               
                PFUN_SetWindowTheme pFun = (PFUN_SetWindowTheme)GetProcAddress(hInst, "SetWindowTheme");
       
                if (pFun)
                    pFun(GetSafeHwnd(), L"", L"");        //去掉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);
            }
        }

        BOOL CDBFrame::OnNcActivate( BOOL bActive )        //避免每次激活时vista重画边框
        {
            return TRUE;
        }

  • 相关阅读:
    Linux下文件权限的设置
    JavaEE中一些缩写的含义
    Xcode7.1环境下上架iOS App到AppStore 流程 转
    iOS UILabel UITextView自适应文本,或文本大小自适应
    Xcode常用快捷键总结
    iOS9的新特性以及适配方案-----转载
    Python下读取转换unicode的json格式
    python pip 不能用报错: ImportError: No module named _internal
    Python获取二维数组的行列数
    Python作用域
  • 原文地址:https://www.cnblogs.com/vc60er/p/1809328.html
Copyright © 2020-2023  润新知