Windows Flicker: Switch OFF performance options

Download Example Project

It looks like switching OFF some animation and disabling Full Window Drag helps quite a bit to make the flicker less disturbing.
By using declares, it is possible to switch these options on and off. In the above sample project you find a module which you may want to test with your Windows projects.

To reduce flicker in Windows applications we temporarily switch off the following performance options:

  • Animate controls and elements inside windows
  • Animate windows when minimizing and maximizing
  • Show window contents while dragging

We save the current user settings in the open event handler of Window1.
We switch off the above settings in the Activate event handler.
We restore the user settings in the Deactivate and Close event handler.

  1. Add the module WIN to your project
  2. Add eventhandlers to your Window1 and call these methods:
    Activate -> PerformanceOptions_OFF
    Close -> PerformanceOptions_RESTORE
    Deactivate -> PerformanceOptions_RESTORE
    Open -> PerformanceOptions_SAVE

Let me know if it works for you or not, Thanks!

Performance Options:

Hhhmmm…I could see some users getting fairly upset that you’re changing system level settings. I understand you’re restoring them, BUT, I still can see some getting ticked off.

One could easily create an option in preferences to allow/disallow such interception for the application only. If I remember right, what I am showing here is what was done in Outlook 2003 by Microsoft itself…

Interesting. Thanks for that tidbit of information.

I’d be wanting to do that at the point when a window started to be resized, and undone at the end.

Restoring is fine, but what if your app crashes?

[quote=151898:@Jeff Tullin]I’d be wanting to do that at the point when a window started to be resized, and undone at the end.

Restoring is fine, but what if your app crashes?[/quote]

I know it’s been a while, but just to be complete.

I tried to go PerformanceOptions_OFF in MouseMove when the mouse cursor gets within 1 pixel of the window’s edge or more, instead of in Activate. Then PerformanceOptions_RESTORE when the mouse gets back within the window. Problem is, there are cases when the cursor has not yet entered the window but still the bidirectional arrow cursor appears. So Performances_OFF cannot take place since MouseMove does not occur. So to be complete would probably require tracking the mouse movements in System with a timer.

To mitigate a possible crash, I have added PerformanceOptions_RESTORE in App.UnhandledException and App.Close.

I am in the process of creating an app under Windows 10 Technical Preview, and that was the occasion to notice an interesting peculiarity : Windows 10 has borderless windows, like Mac OS X. I knew, though, that to obtain that effect, Microsoft engineers actually simply rendered the historical 6 pixels border invisible. When applying the Performances_OFF, the frame appears along the edge of the invisible border, 6 pixels away from the visible edge of the window.

It should not be a problem, since that frame only appears for a very short while. But it sort of lifted the curtain behind which Microsoft magic was hidden :wink:

About Mac OS X, I remember Mac OS 9 and possibly 7 used to show a similar frame when moving or resizing windows.