I'm trying to translate the D3DImage sample to pure C# with SharpDX. Direct3D requires a HWND to initialize, and this is how it's done in C++:
WNDCLASSEX g_wc = { sizeof(WNDCLASSEX), CS_CLASSDC, nullptr, 0L, 0L,
GetModuleHandle(nullptr), nullptr, nullptr, nullptr, nullptr, L"Foo", nullptr };
HWND g_windowHandle;
// Create invisible window to get HWND
RegisterClassEx(&g_wc);
g_windowHandle = CreateWindow(L"Foo", L"Foo", WS_OVERLAPPEDWINDOW,
0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr);
// then eventually we can create the device
Direct3DCreate9Ex(D3D_SDK_VERSION, &m_d3d);
m_d3d->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, g_windowHandle,
vertexProcessing | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE,
&d3dpp, nullptr, &m_d3dDevice);
What would be the best way of obtaining this dummy HWND in C#? It must be different from the main window's HWND. My application is a WPF project.