I guess this is more a windows API question, but I think it is also very related to irrlicht.
I have a (skinned) app, and when a certain event is received, I want to display a complete irrlicht app in a child window of the app.
I have created a dll with the irrlicht app, that I call from the main app. When I call the function to load the irrlicht app, I create a new thread(inside the dll) with the HWND(as argument) that I want to use as the window for rendering.
The HWND is passed to irrlicht as an element of "irr::SIrrlichtCreationParameters"
The HWND itself is a pointer to a button(resource in the dialog of the main app), that I paint black to use it as a placeholder for an overlay(used by irrlicht). I try to gain key focus by calling the HWND with SetFocus() from the irrlicht app thread.
I have based this method on the irrlicht example:"14.Win32Window".
Now the big problem: I cannot get key focus in the irrlicht window. Have I done it all wrong or is it just some function I should call;
render irrlicht window in dialog with diffrent thread
I have isolated the problem.
It seem to have to do something with the way I create irrlicht. When I modify the win32window example to use a separate thread for the irrlicht main loop, everything is fine.
When I change the executable into a dll and change the winmain into a function that I call from another windows app, the irrlicht-control (button) doesn't respond anymore and rendering also fails. Why does this happen? It seems to have no effect to make the window a child window of the main app.
Any help is greatly appriciated
It seem to have to do something with the way I create irrlicht. When I modify the win32window example to use a separate thread for the irrlicht main loop, everything is fine.
When I change the executable into a dll and change the winmain into a function that I call from another windows app, the irrlicht-control (button) doesn't respond anymore and rendering also fails. Why does this happen? It seems to have no effect to make the window a child window of the main app.
Any help is greatly appriciated
well I solded the problem. the control that I placed the irrlicht window in(a button on a dialog, like in the example), did not receive any key messages at all. so I changed the control to a custom one with a separate wndproc to handle the key events, an passed them manually to irrlicht.
Still haven't figured out how to render into a child window of a window with WS_EX_LAYERED enabled without mannualy copying the image into it(performance loss!)
Still haven't figured out how to render into a child window of a window with WS_EX_LAYERED enabled without mannualy copying the image into it(performance loss!)