views:

124

answers:

3

I want to minimise my application, take a screenshot of the current desktop and return my application back to its original state.

This has been working fine under windows XP, however under testing on different Vista machines the minimise time of 200 milliseconds is no longer valid.

Is there a way to ask the operating system when it has finished these fancy effects or lookup how long it has been given to perform the operation?

+1  A: 

While I don't know of a way to do what you ask, I have a suggestion: instead of minimizing your application's window, why not hide it (with ShowWindow(SW_HIDE))? That will not be subject to the animation effects, so should be pretty much instantaneous.

DavidK
+1  A: 

Maybe instead minimizing you should bring desktop to front?

n0rd
A: 

The closest I can find is SPI_GETUIEFFECTS, which tells you if such effects are enabled at all.

If enabled, you could of course use SPI_SETUIEFFECTS to turn them off. But that's a rather shotgun method - how would you restore them? It's probably better to temporarily turn off the ones that bother you most.

MSalters