question

kwikc-6845 avatar image
0 Votes"
kwikc-6845 asked kwikc-6845 edited

[Win32] How to render on a window while it is in idle?

That window is in idle here means the window received WM_ENTERIDLE message, like after Alt key was pressed then released.

[Edited]
The rendering is to use DirectX to draw on HWND. While holding on the title bar of the window, all animations were paused.

[Edited]
It is under Windows 7.

Thanks a lot.

Kwik C.

windows-apic++
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I suspect you might be looking for the GetDC API.


0 Votes 0 ·

Thank you for your reply.

It is to use DirectX (not DC) to draw on HWND.

Sorry for not explaining in detail. I have just edited the question.

0 Votes 0 ·

Do you include any DirectX code for rendering in the application's message loop?

0 Votes 0 ·
Show more comments

With Direct2D, there is just a small pause on Title Bar, but animations are not stopped :

146640-direct2d-scrolling.gif


0 Votes 0 ·
XiaopoYang-MSFT avatar image
1 Vote"
XiaopoYang-MSFT answered

I have reproduced the behavior with directx sdk Collision sample. It seems the Pause behavior is normal. DXUTPause traces the behavior.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RLWA32-6355 avatar image
1 Vote"
RLWA32-6355 answered RLWA32-6355 edited

When clicking on the window caption and holding the mouse button down Windows enters a modal loop for window dragging. The system's modal loop will dispatch messages but your message loop is not called. Consequently, any code for DirectX drawing that it contains will not be executed. Windows also enters a modal loop for menu processing.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.