开发者

How to access the Desktop Composition Engine from a WinForms app?

Is it possible to access the Desktop Composition Engine in Windows Vista from a winforms application? The DCE apparently involves applications rendering to DCE buffers instead of directly to the screen. Since a winforms app has no way of getting information about the monitor's refresh rate and scanline status (other than via DirectX), animation in a winforms app is subject to tearing effects. With DCE enabled, the tearing effects are lessened but still there (apparently the DCE can still grab a buffer that your app is halfway through writing to and render i开发者_开发技巧t to the screen, thereby producing the half-one-frame-half-of-the-next tearing effects).

Is there any way for my winforms app to communicate with the DCE and possible avoid rendering during buffer switchover times?


Could you import the DWMAPI.DLL, call DwmGetCompositionTimingInfo, tear apart the DWM_TIMING_INFO struct and synch your app with whatever timing information you can discern?

Alternatively, you might be able to control it with DwmSetDxFrameDuration

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜