How to programmatically disable window animation under Vista Aero?

My application takes automatic screenshots of several dynamically created forms. This works fine under Windows XP, but does not work well under Vista Aero. Most forms appear translucent in the screenshots. The problem is animating the Aero window.

How can I check / disable / enable this animation from Delphi (2007+)?

Or as an alternative: how can I make sure the form displays correctly before taking a screenshot?

+4
source share
3 answers

The link in the comments from Shoban led me in the right direction. A quick check showed the wrapper for DwmApi in VCL and that it went straight. Here is the code that I am successfully using now:

uses DwmApi; ... SaveDwmCompositionEnabled := DwmCompositionEnabled; if SaveDwmCompositionEnabled then DwmEnableComposition(DWM_EC_DISABLECOMPOSITION); ... if SaveDwmCompositionEnabled then DwmEnableComposition(DWM_EC_ENABLECOMPOSITION); 
0
source

Disabling Aero would be very pathetic - in general, it is not recommended to change the user style of the UI.

You can make the form in a different way. One thing that comes to mind is to use the PaintTo method to draw it on canvas. (In fact, if you take screenshots of the forms as a way to get what it looks like, you probably don't need to display the forms at all, created them using Visible set false and painted them in a bitmap. Show them if the user needs to interact with them .)

+1
source

You can add a manifest resource to an exe file to notify Vista that the application is running without Aero http://www.google.be/search?q=vista+manifest+resource+delphi

0
source

All Articles