Why does the Windows OS hangs for a while when scrolling up/down from my MFC application?

Charisma Delos Reyes 0 Reputation points
2025-08-11T07:51:51.83+00:00

I have an MFC application that has many different types of controls displayed in a grid. The different type of control changes based on data type. The whole desktop hangs upto 30seconds if I scroll up/down on my MFC application. This issue was not reported when most of our users were on Windows 7.

The exact sequence of actions triggering the hang is:

  1. Scroll horizontally up/down many times (using the horizontal scroll-bar)
  2. Click on other application
  3. Whole desktop hangs for about 20-30 seconds, then recovers

My questions are:

  1. Are there any changes in Windows 10 w.r.t. redrawing or repainting the window, which may interact with scrolling to cause a hang?
  2. How to resolve the hang of the whole desktop?
Windows for business | Windows Server | Performance | Windows desktop and shell experience
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Quinnie Quoc 0 Reputation points Independent Advisor
    2025-08-12T05:14:05.8566667+00:00

    Dear Charisma Delos Reyes,

    Thank you for your detailed description of the issue. I understand how disruptive it can be when an application causes the entire desktop to hang, and I appreciate the clarity you've provided regarding the sequence of actions that trigger the behavior.

    Observations & Context

    The behavior you're encountering—desktop-wide hangs following intensive scrolling in an MFC application—does appear to correlate with changes introduced in Windows 10, particularly in the graphics and window management subsystems. While Windows 7 relied more heavily on GDI-based rendering, Windows 10 introduced a more complex composition model via the Desktop Window Manager (DWM), which can affect how redraws and repaints are handled, especially under high UI load or when multiple applications are competing for GPU resources.

    Potential Causes

    • DWM Composition Overhead: Excessive or inefficient redraws in your MFC grid may be overwhelming the DWM, especially if the controls are dynamically changing based on data type.

    UI Thread Blocking: If your application’s UI thread is performing synchronous operations during scroll events, it may be causing a stall that propagates across the desktop.

    Driver or GPU Bottlenecks: Outdated or incompatible graphics drivers can exacerbate redraw latency, particularly in applications with custom rendering logic.

    Recommended Steps

    Optimize Redraw Logic Review your scroll event handlers and ensure that redraws are minimized. Consider using InvalidateRect selectively and avoid full-window repaints unless necessary.

    Enable Double Buffering If not already implemented, enable double buffering to reduce flicker and improve rendering performance during scroll operations.

    Profile UI Thread Activity Use tools like Windows Performance Recorder (WPR) and Visual Studio Profiler to analyze thread activity during scroll events. Look for blocking calls or excessive message handling.

    Update Graphics Drivers Ensure that all systems are running the latest certified graphics drivers for Windows 10. This can significantly improve DWM performance and reduce UI latency.

    Test with DWM Disabled (for diagnostic purposes) While not recommended for production, temporarily disabling DWM composition (via registry or compatibility settings) may help isolate whether the issue is composition-related.

    Hope that my answer is useful for you.

    Best regards,

    Quinnie Quoc.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.