HWND in Irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Yosepp
Posts: 2
Joined: Mon Feb 02, 2004 2:28 pm

HWND in Irrlicht

Post by Yosepp »

I was wondering how could one get the HWND from Irrlicht, i would like to use it in DirectInput. Thanks!
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post by [dx/x]=HUNT3R »

Just get it thru your WinMain function.
Phunk
Posts: 78
Joined: Sun Dec 14, 2003 8:18 pm
Location: The Netherlands

Post by Phunk »

maybe a note to some user: if you create irrlicht in a dos-box(usin main() ), it is not easy to get the HWND, but if you need the HWND, you might as well create a win32 project with a winmain function, then you can get it, because (i think) the render window is then a child of your program, and thus accesible trough the HWND created by you in the winmain function. Please correct me if I'm wrong, cause I've not tested/checked this, its just an assumtion.
Guest

Post by Guest »

you wrong :)

Code: Select all

HWnd = CreateWindow( ClassName, "", style, windowLeft, windowTop, realWidth, realHeight,	[b]NULL[/b], NULL, hInstance, NULL);
this is the code in CIrrDeviceWin32 constructor wich creates window. "Bold" NULL :) is a window parent. Actually window handler is stored in the CIrrDeviceWin32 class object but you cannot reach it (it's private).

So you can make a small trick: Set a very unique :) caption like this:

Code: Select all

device->setWindowCaption(L"A very unique caption");
and then call

Code: Select all

HWND hWnd = FindWindow(NULL, "A very unique caption");
Now hWnd is a handle that you need :)
Phunk.

Post by Phunk. »

ok, my bad, next time Ill check before I write :-) it will not happen again!
Linuxhippy
Posts: 5
Joined: Mon Feb 02, 2004 9:43 am

Why???

Post by Linuxhippy »

I dont understand why working with win32. You loose all the great portability benefits irrlicht provides you.
That's the same stupid thing as aborting if FullScreenMode is not available in Java-1.4, so it isnt possible to run that app under Linux even it should run.
Guest

Post by Guest »

I know: you are one of those guys who will always proving that MS is suxx and penguin is the best animal in the world. :)

Nothing personal :)
Linuxhippy
Posts: 5
Joined: Mon Feb 02, 2004 9:43 am

Nööö

Post by Linuxhippy »

No, thats not absolutly true. Otherwise I would suggest no to port the game to windows :-)
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Re: Nööö

Post by [dx/x]=HUNT3R »

Linuxhippy wrote:no to port the game to windows :-)
That's funny... bad penguin.
Post Reply