views:

444

answers:

3

What I want to do is have a Windows application launch another Direct3D application and have the Direct3D application render into a control provided by the parent process.

Is this even possible? If it is, how would it be done?

A: 

This is possible. I remember doing it in VB6 when writing screen savers. The screen saver control panel sends a commandline to the screen saver with the HWND of the preview window. Using that HWND, you can then get the HDC and from there everything else you need.

RichieACC
+3  A: 

It can be done easly, all you need to do is pass the HWND window id as a parameter when creating D3DDevice. It even works during interop - you can pass the hWnd from .NET to C++ and render C# window using native directX.

Dror Helper
A: 

Here's one example, hosting content of a WPF window in an existing Win32 window. I did this when writing a WPF-based screen saver, having to render into the Screen Saver little preview window.

http://stuff.seans.com/2008/09/01/writing-a-screen-saver-in-wpf/

Sean Sexton