开发者

Is it possible to redirect output of a Win32 application to a Picture Box?

I've previously seen code samples that redirect Windows Media Player's output to a Picturebox in C#. I am interested in doing this for other Win32 applications. Considering the fact that I can get hWnd handle of the process that I want t开发者_StackOverflow中文版o redirect its output, how can I accomplish my goal?

I can minimize/maximize the process' window using user32.dll's ShowWindow method, so I am guessing there should be a solution for my problem.

Thanks.


I'd suggest reading about Desktop Windows Manager (feature introduced in Windows Vista): http://msdn.microsoft.com/en-us/library/aa969540(v=VS.85).aspx

I believe it has the capabilities you seek.

I would start by reading about the DwmRegisterThumbnail function, which attaches two HWNDs so that one window is also painted on the second one. Using this method you may be able to cause Windows Media Player to be drawn on the HWND obtained from your PictureBox.Handle property.

There are also a lot of questions and answers about this topic here in StackOverflow. Using the search word "dwm" yields quite a few results: https://stackoverflow.com/search?q=dwm

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜