✅ Get window handle when it's created
In my WPF app, I want to embed the window from a
I'm extending
I create a Process with the executable, and start it.
The Unity player obviously takes a bit to load and the window is not created immediately (not even after calling
Is there some way of getting the player window handle immediately when it is created?
I tried
- Using
- Using
Ideally I want to start the player process and when it creates the main window immediately embed it, without it flashing on the screen or showing in the task bar.
Process (a Unity player application).I'm extending
HwndHost to host it in a control.I create a Process with the executable, and start it.
The Unity player obviously takes a bit to load and the window is not created immediately (not even after calling
Process.WaitForInputIdle).Is there some way of getting the player window handle immediately when it is created?
I tried
- Using
Process.MainWindowHandle, but that value is not set until it's created, so I'd have to block the thread waiting for it.- Using
EnumChildWindows, may be a bit more reliable, but has the same issue as above.Ideally I want to start the player process and when it creates the main window immediately embed it, without it flashing on the screen or showing in the task bar.
