How to redirect an arbitrary window to be displayed in the memory buffer in memory?

I am experimenting with a home application hosting infrastructure, and I would like to abstract I / O so that I can gracefully handle failures. Chrome uses a very similar model.

Is there any way to take an arbitrary window handle and convince it to start rendering to the inverse buffer? Or should I first create my own window and then add the client application to it?

+4
source share
1 answer

As the comments say, you can do anything if you are ready to dig and plug in the APIs yourself, but according to the comments in MSDN WM_PAINT, the WM_PRINT page is a supported way to make the window draw on a specific DC.

It looks like you also need not to show the window on the desktop - in this case you can use WM_SETREDRAW, as described in Win32, can I turn off window drawing for a while? .

+3
source

Source: https://habr.com/ru/post/1442593/


All Articles