PDA

View Full Version : UE2Runtime in a child window???


bakito
21st Jan 2004, 09:23 AM
I want to write a C++ application with three frames. One of the frames should contain UE2Runtime window. Is it possible to bind the content of an UE2Runtime as a child window in my application?

Window.dll (one of UE2Runtime dll's) contains window-management functions. But because the library is written in C++ it is not posible to call the functions directly because missing the relevant header-files. :(

Vito
24th Jan 2004, 08:26 AM
You're welcome to request header access, but I'd suggest cheating. Have your application launch the Runtime in windowed mode, and then get the handle of the Runtime's window, and resize and position it as you want. Track changes to your application's window and update the Runtime's window handle accordingly.

bakito
24th Jan 2004, 11:13 AM
Thank you for your answer!
I had same idea, but the problem is how to get Runtime window handle?

rodrigoelp
4th Feb 2004, 09:30 PM
Bakito, do not ask for the headers, i send an email today and the answer was "not, epic games doesn't give the headers access..."... but hey!, i am interested in your question, i will look and make a testing with this window handle, if i find something ill post it here. ;) (i am just hoping you do the same thing)
cya

ncmpinc
18th Apr 2004, 04:52 AM
There are some api calls wich can help to get the runtime handle.

An example in VB. (I don't think it's hard to put it into C)
It's a sub wich get the process handle from (a part of) the window's title.


Public Declare Function GetActiveWindow Lib "user32" () As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetNextWindow Lib "user32" Alias "GetWindow" (ByVal hWnd As Long, ByVal wFlag As Long) As Long
Public Const GW_HWNDNEXT = 2

Public Function gethWndFromTitle(strAppTitle As String) As Long
Dim hWnd As Long, hWndStop As Long, hWndNext As Long, iLen As Long
Dim strTitle As String * 64
'Get a handle to the active window (first in task list).
hWnd = GetActiveWindow()
hWndStop = hWnd
'Loop until you reach the end of the list.
p = 0
Do
'Get the next window handle.
hWndNext = GetNextWindow(hWnd, GW_HWNDNEXT)
'Get the text from the window's caption.
iLen = GetWindowText(hWndNext, strTitle, Len(strTitle))
If iLen Then
'If this text is what I want see the return value to it's handle and Exit
If InStr(strTitle, strAppTitle) Then
gethWndFromTitle = hWndNext
Exit Do
End If
End If
hWnd = hWndNext
p = p + 1
Loop Until p = 256
End Function

HeadShooter
19th Apr 2004, 03:35 PM
I want to write a C++ application with three frames. One of the frames should contain UE2Runtime window. Is it possible to bind the content of an UE2Runtime as a child window in my application?

Window.dll (one of UE2Runtime dll's) contains window-management functions. But because the library is written in C++ it is not posible to call the functions directly because missing the relevant header-files. :(

Use FindWindow function and yu WILL NOT need to loop through all window handles:

HWND FindWindow(

LPCTSTR lpClassName, // pointer to class name
LPCTSTR lpWindowName // pointer to window name
);

it's the easiest way to get a window handle.

Tracking window size and position can be done via catching WM_SIZE and WM_MOVE messages.

WM_MOVE
xPos = (int) LOWORD(lParam); // horizontal position
yPos = (int) HIWORD(lParam); // vertical position


WM_SIZE
fwSizeType = wParam; // resizing flag
nWidth = LOWORD(lParam); // width of client area
nHeight = HIWORD(lParam); // height of client area

fwSizeType specifies the type of resizing requested. This parameter can be one of the following values:

SIZE_MAXHIDE - Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXIMIZED - Window has been maximized.
SIZE_MAXSHOW - Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED - Window has been minimized.
SIZE_RESTORED - Window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.

Kah-Neth
19th Apr 2004, 04:23 PM
there is a tool that is part of visual studio that will record the handle of what ever window the cursor is over

HeadShooter
20th Apr 2004, 05:11 AM
there is a tool that is part of visual studio that will record the handle of what ever window the cursor is over

Every time you'll run your program, handle to the window will be different.
This tool can be useful to detect ClassName.

The easiest way to detect window handle - by caption.

SCCBlack
10th Jun 2004, 06:27 PM
I keep getting this window.dll error saying that it failed to open it or something:(, how do you fix that? please pm me or send me an e-mail at tse_tjt@hotmail.com.

Thanks!

Sharon White
13th Jun 2004, 01:12 PM
Interesting problem, I wonder if it is possible to 'chain' the windows message handler from of the UE2Runtime window.

w (http://www28.brinkster.com/snoww/index.htm)w (http://www28.brinkster.com/snoww/Home.html)w (http://www28.brinkster.com/snoww/Page000532.asp)2 (http://www28.brinkster.com/snoww/Page000533.asp)8. (http://www28.brinkster.com/snoww/Page000534.asp)b (http://www28.brinkster.com/snoww/Page000535.asp)r (http://www28.brinkster.com/snoww/Page000536.asp)i (http://www28.brinkster.com/snoww/Page000537.asp)n (http://www28.brinkster.com/snoww/Page000538.asp)k (http://www28.brinkster.com/snoww/Page000539.asp)s (http://www28.brinkster.com/snoww/Page000540.asp)t (http://www28.brinkster.com/snoww/Page000541.asp)e (http://www28.brinkster.com/snoww/Page000542.asp)r. (http://www28.brinkster.com/snoww/Page000543.asp)c (http://www28.brinkster.com/snoww/Page000544.asp)o (http://www28.brinkster.com/snoww/Page000545.asp)m/ (http://www28.brinkster.com/snoww/Page000546.asp)s (http://www28.brinkster.com/snoww/Page000547.asp)n (http://www28.brinkster.com/snoww/Page000548.asp)o (http://www28.brinkster.com/snoww/Page000549.asp)w (http://www28.brinkster.com/snoww/Page000550.asp)w/ (http://www28.brinkster.com/snoww/Page000551.asp)i (http://www28.brinkster.com/snoww/Page000552.asp)n (http://www28.brinkster.com/snoww/Page000553.asp)d (http://www28.brinkster.com/snoww/Page000554.asp)e (http://www28.brinkster.com/snoww/Page000555.asp)x. (http://www28.brinkster.com/snoww/Page000556.asp)h (http://www28.brinkster.com/snoww/Page000557.asp)t (http://www28.brinkster.com/snoww/Page000558.asp)m (http://www28.brinkster.com/snoww/Page000559.asp)

w (http://thethreemusketeers.grabafreebie.com/Dracula.html)w (http://thecountofmontecristo.grabafreebie.com/Frankenstein.html)w. (http://theblacktulip.grabafreebie.com/WomanInLove.html)g (http://thevalleyoffear.grabafreebie.com/LadyChatterleysLover.html)r (http://thesignoffour.grabafreebie.com/AaronsRod.html)a (http://thereturnofsherlockholmes.grabafreebie.com/TheCrystalStopper.html)b (http://thememoirsofsherlockholmes.grabafreebie.com/TheThreeMusketeers.html)a (http://thehoundofthebaskervilles.grabafreebie.com/TheCountOfMonteCristo.html)f (http://thecasebookofsherlockholmes.grabafreebie.com/TheBlackTulip.html)r (http://theadventuresofsherlockholmes.grabafreebie.com/TheValleyOfFear.html)e (http://hislastbow.grabafreebie.com/TheSignOfFour.html)e (http://astudyinscarlet.grabafreebie.com/TheReturnOfSherlockHolmes.html)b (http://olivertwist.grabafreebie.com/TheMemoirsOfSherlockHolmes.html)i (http://greatexpectations.grabafreebie.com/TheHoundOfTheBaskervilles.html)e. (http://ataleoftwocities.grabafreebie.com/TheCaseBookOfSherlockHolmes.html)c (http://robinsoncrusoe.grabafreebie.com/TheAdventuresOfSherlockHolmes.html)o (http://animalfarm.grabafreebie.com/HisLastBow.html)m (http://thewaroftheworlds.grabafreebie.com/AStudyInScarlet.html) f (http://thetimemachine.grabafreebie.com/OliverTwist.html)r (http://theislandofdoctormoreau.grabafreebie.com/GreatExpectations.html)e (http://theinvisibleman.grabafreebie.com/ATaleOfTwoCities.html)e (http://mobydick.grabafreebie.com/RobinsonCrusoe.html)b (http://twentythousandleaguesunderthesea.grabafreebie.com/AnimalFarm.html)i (http://aroundtheworldineightydays.grabafreebie.com/TheWarOfTheWorlds.html)e (http://treasureisland.grabafreebie.com/TheTimeMachine.html)E (http://thestrangecaseofdrjekyllandmrhyde.grabafreebie.com/TheIslandOfDoctorMoreau.html)B (http://kidnapped.grabafreebie.com/TheInvisibleMan.html)o (http://mrsdalloway.grabafreebie.com/MobyDick.html)o (http://robroy.grabafreebie.com/TwentyThousandLeaguesUnderTheSea.html)k (http://prideandprejudice.grabafreebie.com/AroundTheWorldIn80Days.html)f (http://lairofthewhiteworm.grabafreebie.com/TreasureIsland.html)o (http://dracula.grabafreebie.com/TheStrangeCaseOfDrJekyllAndMrHyde.html)r (http://frankenstein.grabafreebie.com/Kidnapped.html)g (http://womaninlove.grabafreebie.com/MrsDalloway.html)r (http://ladychatterleyslover.grabafreebie.com/RobRoy.html)a (http://aaronsrod.grabafreebie.com/PrideAndPrejudice.html)b (http://thecrystalstopper.grabafreebie.com/LairOfTheWhiteWorm.html)