zoukankan      html  css  js  c++  java
  • 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;
        }

  • 相关阅读:
    keepalived高可用+nginx证书代理
    dfs缩略图
    FastDFS分布式图片服务器搭建
    red5视频播放服务器
    压力测试操作流程
    mysql主从库配置读写分离以及备份
    jdk环境
    mysql主从库配置读写分离以及备份
    mysql5.7.26安装
    数据库异地备份(脚本)
  • 原文地址:https://www.cnblogs.com/vc60er/p/1809328.html
Copyright © 2011-2022 走看看