Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3628316
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:00:01+00:00 2026-05-19T00:00:01+00:00

I need to identify some wnds in my application (objects of CMDIChildWnd class). To

  • 0

I need to identify some wnds in my application (objects of CMDIChildWnd class).
To do this i am using a timer to draw the border of the wnd with specific color alternatively so as to give the feel of blinking. This works perfectly fine on WinXP machines, but faires miserably on Win7 machines; there is significant delay in painting the highlighted border.
However when switched to optimize for best performance setting everything works just smooth.

I am using CCLinetDC::Rectangle() method to draw the border. Is there some known issue with this API in Win7? How can I make it work on Win7 as well?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T00:00:02+00:00Added an answer on May 19, 2026 at 12:00 am

    You could try with disabling NC area painting.

    Something like below:

    #include <dwmapi.h>
    ...
    
    HRESULT hr = E_FAIL;
    if (IsVistaOrAbove())
    {
        DWMNCRENDERINGPOLICY ncrp = DWMNCRP_DISABLED;
        hr = ::DwmSetWindowAttribute(m_hWnd, DWMWA_NCRENDERING_POLICY, &ncrp, sizeof(ncrp));
        ASSERT(SUCCEEDED(hr));
    }
    

    But it also disables Aero on the window.

    So it would be more straightforward to show blink in the client area not in the border.

    UPDATED

    For XP compatibility, you should use DWM APIs like this:

    typedef HRESULT (WINAPI *pfnDwmIsCompositionEnabled)(BOOL *pfEnabled);
    static pfnDwmIsCompositionEnabled s_DwmIsCompositionEnabled;
    typedef HRESULT (WINAPI *pfnDwmSetWindowAttribute)(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute);
    static pfnDwmSetWindowAttribute s_DwmSetWindowAttribute;
    typedef HRESULT (WINAPI *pfnDwmGetWindowAttribute)(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute);
    static pfnDwmGetWindowAttribute s_DwmGetWindowAttribute;
    
    
    HMODULE hSysDll = LoadLibrary(_T("dwmapi.dll"));
    if(hSysDll) // Loaded dwmapi.dll success, must Vista or above
    {
        s_DwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hSysDll, "DwmIsCompositionEnabled");
        s_DwmSetWindowAttribute = (pfnDwmSetWindowAttribute)GetProcAddress(hSysDll, "DwmSetWindowAttribute");
        s_DwmGetWindowAttribute =  (pfnDwmGetWindowAttribute)GetProcAddress(hSysDll, "DwmGetWindowAttribute");
    }
    ...  
    ...  
    bool IsAeroEnabled()
    {
        BOOL bAero = FALSE;
        if(s_DwmIsCompositionEnabled)
            s_DwmIsCompositionEnabled(&bAero);
        return bAero != FALSE;
    }
    ...  
    ...  
    HRESULT ProxyDwmSetWindowAttribute(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute)
    {
        if (s_DwmSetWindowAttribute)
        {
            return s_DwmSetWindowAttribute(hwnd, dwAttribute, pvAttribute, cbAttribute);
        }
        return E_FAIL;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to identify some locations in a file where certain markers might be.
I'm dealing with a legacy system where I need to identify some bad records
We need to identify and then process switch/case statements in code based on some
I need to optimise a Java application. It makes some 3rd party calls. I
I'm building a spreadsheet app using MySQL as storage, I need to identify records
I'm coding some scripts which execute git-rebase and need to identify when a conflict
I have a C code base and need to programmatically identify all of the
need ask you about some help. I have web app running in Net 2.0.
I need to do some tests, and make DB out of the testing result.
I need to identify users according to an URI subset. It has the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.