zoukankan      html  css  js  c++  java
  • MFC去掉win7玻璃效果

    在MainFrame的OnCreate中添加以下代码

    if (CWnd::OnCreate(lpCreateStruct) == -1) return -1;

    HINSTANCE hInstance = LoadLibrary(_T("UxTheme.dll"));
    if (hInstance)
    {
    typedef HRESULT (WINAPI *PFUN_SetWindowTheme)(HWND,LPCTSTR,LPCTSTR);
    PFUN_SetWindowTheme pFun = (PFUN_SetWindowTheme)GetProcAddress(hInstance,"SetWindowTheme");
    if (pFun)
    {
    pFun(m_hWnd,_T(""),_T(""));
    }
    FreeLibrary(hInstance);
    }
    hInstance = LoadLibrary(_T("dwmapi.dll"));
    if (hInstance)
    {
    typedef HRESULT (WINAPI *TmpFun)(HWND,DWORD,LPCVOID,DWORD);
    TmpFun DwmSetWindowAttributeEX = (TmpFun)::GetProcAddress(hInstance,"DwmSetWindowAttribute");
    if (DwmSetWindowAttributeEX)
    {
    DWORD dwAttr = 1;
    DwmSetWindowAttributeEX(GetSafeHwnd(),2,&dwAttr,4);
    }
    FreeLibrary(hInstance);
    }

    添加WM_NCACTIVE消息函数
    BOOL CMainFrame::OnNcActivate(BOOL bActive)
    {
    BOOL bRet = CWnd::OnNcActivate(bActive);
    SendMessage(WM_NCPAINT,0,0);
    Invalidate();
    return bRet;
    }

  • 相关阅读:
    守卫者的挑战
    黑魔法师之门
    noip2015 普及组
    noip2015 提高组day1、day2
    40026118素数的个数
    高精度模板
    经典背包系列问题
    修篱笆
    [LintCode] Linked List Cycle
    [LintCode] Merge Two Sorted Lists
  • 原文地址:https://www.cnblogs.com/XCoderLiu/p/3691997.html
Copyright © 2011-2022 走看看