如何检测桌面过渡效果?

时间:2021-05-04 19:41:46

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.

这在Windows XP下运行良好,但是在不同的Vista机器上进行测试时,200毫秒的最小化时间不再有效。

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?

有没有办法在操作系统完成这些花哨效果后询问操作系统或查看执行操作所需的时间?

3 个解决方案

#1


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

我能找到的最接近的是SPI_GETUIEFFECTS,它告诉你这些效果是否完全启用。

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.

如果启用,您当然可以使用SPI_SETUIEFFECTS将其关闭。但这是一种相当霰弹枪的方法 - 你会如何恢复它们?暂时关掉那些最困扰你的人可能会更好。

#2


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.

虽然我不知道如何做你要求的方法,但我有一个建议:为什么不隐藏它(使用ShowWindow(SW_HIDE))而不是最小化你的应用程序窗口?这不会受到动画效果的影响,所以应该是瞬间完成的。

#3


Maybe instead minimizing you should bring desktop to front?

也许最小化你应该把桌面带到前面?

#1


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

我能找到的最接近的是SPI_GETUIEFFECTS,它告诉你这些效果是否完全启用。

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.

如果启用,您当然可以使用SPI_SETUIEFFECTS将其关闭。但这是一种相当霰弹枪的方法 - 你会如何恢复它们?暂时关掉那些最困扰你的人可能会更好。

#2


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.

虽然我不知道如何做你要求的方法,但我有一个建议:为什么不隐藏它(使用ShowWindow(SW_HIDE))而不是最小化你的应用程序窗口?这不会受到动画效果的影响,所以应该是瞬间完成的。

#3


Maybe instead minimizing you should bring desktop to front?

也许最小化你应该把桌面带到前面?