UE2Runtime in a child window???

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

bakito

New Member
Jan 21, 2004
2
0
0
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

New Member
Mar 18, 2002
143
0
0
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

New Member
Jan 21, 2004
2
0
0
Thank you for your answer!
I had same idea, but the problem is how to get Runtime window handle?
 

rodrigoelp

New Member
Feb 1, 2004
15
0
0
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

New Member
Apr 12, 2004
13
0
0
Getting the Runtime Handle

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.

Code:
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
[COLOR=Green]'Get a handle to the active window (first in task list).[/COLOR]
    hWnd = GetActiveWindow()
    hWndStop = hWnd
[COLOR=Green]'Loop until you reach the end of the list.[/COLOR]
    p = 0
    Do
[COLOR=Green]'Get the next window handle.[/COLOR]
        hWndNext = GetNextWindow(hWnd, GW_HWNDNEXT)
[COLOR=Green]'Get the text from the window's caption.[/COLOR]
        iLen = GetWindowText(hWndNext, strTitle, Len(strTitle))
        If iLen Then
[COLOR=Green]'If this text is what I want see the return value to it's handle and Exit[/COLOR]
            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

New Member
Mar 30, 2004
12
0
0
44
Moscow, Russia
bakito said:
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.
 
Last edited:

HeadShooter

New Member
Mar 30, 2004
12
0
0
44
Moscow, Russia
Kah-Neth said:
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

New Member
Jun 10, 2004
7
0
0
WINDOW.DLL HELP!

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!