Jump to content
Sign in to follow this  
t0ddie

window in gui

Recommended Posts

t0ddie

i think i have seen this before, but i dont have any code

i want to put a window inside of a gui.

is there an easy way to do this?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
seandisanti

i think i have seen this before, but i dont have any code

i want to put a window inside of a gui.

is there an easy way to do this?

what do you mean 'a window'?

Share this post


Link to post
Share on other sites
t0ddie

i mean can you wrap a gui around a window, like internet explorer. or any window

you would have to resize the window of course.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
seandisanti

i mean can you wrap a gui around a window, like internet explorer. or any window

you would have to resize the window of course.

you can create an IE object and display it within a GUI, if that's what you mean...

Share this post


Link to post
Share on other sites
t0ddie

well i have a window for a game that i want to put inside a console.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
t0ddie

this is kind of like what i mean.

i have moved the window, and placed a gui along side of it and a splashscreen on top.

i want something like this, but the splashscreen area should be gui instead of splashscreen.

it should be part of the gui, so when i minimize/maximize the gui, the window will also minimize/maximize.

EDIT: i uploaded screenshot as attachment but its not showing up.

here is a pic http://www.angelfire.com/ex/u/test.html

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
t0ddie

a gui wrapper for a window. is it possible?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
t0ddie

so its NOT possible then?? lol BUMP :P


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
seandisanti

so its NOT possible then?? lol BUMP :P

just out of curiousity, i'll give you a free bump to ask how much you've researched this yourself while waiting on someone else to do it for you... :lmao:

Share this post


Link to post
Share on other sites
peter1234

t0ddie,

I think maybe you need to explain more what you want. Why can't you just put a child window in your main GUI?

Share this post


Link to post
Share on other sites
Holger

Sample (Beta-Version needed):

#include <GUIConstants.au3>

$hGUI = GUICreate("Test", 800, 600, -1, -1, BitOr($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN))

$PID    = Run(@WindowsDir & "\regedit.exe", "", @SW_HIDE)
$hWnd   = 0
$stPID  = DllStructCreate("int")

Do
    $WinList = WinList()
    For $i = 1 To $WinList[0][0]
        If $WinList[$i][0] <> "" Then
            DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $WinList[$i][1], "ptr", DllStructGetPtr($stPID))
            If DllStructGetData($stPID, 1) = $PID Then
                $hWnd = $WinList[$i][1]
                ExitLoop
            EndIf
        EndIf
    Next
    Sleep(100)
Until $hWnd <> 0

$stPID = 0

If $hWnd <> 0 Then
    $nExStyle = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hWnd, "int", -20)
    $nExStyle = $nExStyle[0]
    DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", -20, "int", BitOr($nExStyle, $WS_EX_MDICHILD))
    DllCall("user32.dll", "int", "SetParent", "hwnd", $hWnd, "hwnd", $hGUI) 
    WinSetState($hWnd, "", @SW_SHOW)
    WinMove($hWnd, "", 0, 0, 600, 400)
EndIf

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
WEnd

Maybe there are some other ways, easier...don't know...

So long

Holger

Edited by Holger

Share this post


Link to post
Share on other sites
Shinies

Im pretty sure what he wants is like nesting the program inside his GUI like that, but with no System Bar and no moving etc.

Share this post


Link to post
Share on other sites
t0ddie

Im pretty sure what he wants is like nesting the program inside his GUI like that, but with no System Bar and no moving etc.

yes. exactly that.


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites
tonedeaf

Sample (Beta-Version needed):

#include <GUIConstants.au3>

$hGUI = GUICreate("Test", 800, 600, -1, -1, BitOr($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_CLIPCHILDREN))

$PID    = Run(@WindowsDir & "\regedit.exe", "", @SW_HIDE)
$hWnd   = 0
$stPID  = DllStructCreate("int")

Do
    $WinList = WinList()
    For $i = 1 To $WinList[0][0]
        If $WinList[$i][0] <> "" Then
            DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $WinList[$i][1], "ptr", DllStructGetPtr($stPID))
            If DllStructGetData($stPID, 1) = $PID Then
                $hWnd = $WinList[$i][1]
                ExitLoop
            EndIf
        EndIf
    Next
    Sleep(100)
Until $hWnd <> 0

$stPID = 0

If $hWnd <> 0 Then
    $nExStyle = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hWnd, "int", -20)
    $nExStyle = $nExStyle[0]
    DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", -20, "int", BitOr($nExStyle, $WS_EX_MDICHILD))
    DllCall("user32.dll", "int", "SetParent", "hwnd", $hWnd, "hwnd", $hGUI) 
    WinSetState($hWnd, "", @SW_SHOW)
    WinMove($hWnd, "", 0, 0, 600, 400)
EndIf

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
WEnd

Maybe there are some other ways, easier...don't know...

So long

Holger

I didn't knew what I was trying before I ran this program.

:lmao: amazing...Just what I needed some time ago, but never thought possible.

Nice one Holger.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.