hWnd of Irrlicht Device Window

Discussion about everything. New games, 3d math, development tips...
Post Reply
WalterWzK

hWnd of Irrlicht Device Window

Post by WalterWzK »

Hi,

I'm trying to get the hWnd of the Irrlicht Device Window. I do it like this:

Code: Select all

'Functie voor zoeken van 3DEngine venster
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer

'Ophalen van hWnd
Dim hThreadId As Integer = FindWindow("Type32_Main_Window", "Exclusive-IT SiteClient 3D")
The first stuff are the API calls and the second should retrieve the hWnd cuz the device.windowtitle is set to "Exclusive-IT SiteClient 3D". But it does not work.

Question: Anyone else ever tried to catch the hWnd of the device window, and if so.. how the **** did you do it? LOL

Thanks already

[Ps: using VB.Net 2005, Irrlicht 0.71, .NET Wrapper for Irrlicht, Newton 3.0, .NET Wrapper for Newton ]
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

use the exposed video data structure. See the IVideoDriver class reference
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.

Crucible of Stars
Murphy
Posts: 290
Joined: Mon Dec 13, 2004 12:06 am
Location: United States
Contact:

Post by Murphy »

Yeah, a better way would be to use the info Irrlicht exposes, but maybe the .Net version doesn't expose it (I haven't looked).

Where did you get "Type32_Main_Window" from? A quick look showed the window class to be "CIrrDeviceWin32" if I'm not mistaken. Or does the .Net version not create a window the same way (seems unlikely)?

Try using Spy++. Or do the FindWindow based on window title alone (pass NULL for the class parameter), and then use GetClassName() to see what the class name is.
WalterWzK

Post by WalterWzK »

I love you both!! :D

Thanks for the help, and indeed the .NET version does not yet have the exposing stuff. But the class 'CIrrDeviceWin32' is right! So I'll give it a try and look for that class and window caption, with a little luck i'll retrieve a hWnd!!

Dudes!.. thanks again!
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

You can add a function getWindow to CIrrDeviceWin32, but in order to call it from your device, you need to create a pure virutal function in IrrlichtDevice.h. I tried it and it works.
Post Reply