Jump to content
Sign in to follow this  
Minikori

One window in another?

Recommended Posts

Minikori

Hello, I was wondering if it's possible to make one GUI (such as a tool window) inside of my main GUI. Some examples of this are in Hammer Editor or Paint Shop Pro where there are windows inside of the edit space in the main window, and these windows can't leave that space. If you have any help it'd be greatly appreciated, thank you.


For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites
smashly

Hi,

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$hParent = GUICreate(":-)", 600, 400, -1, -1)
$iShowTool = GUICtrlCreateButton("Show Tool", 10, 10, 80, 20)
GUISetState(@SW_SHOW, $hParent)

$hChild = GUICreate("Tool", 200, 50, 200, 150, BitOR($WS_OVERLAPPEDWINDOW, $WS_CHILD) , $WS_EX_TOOLWINDOW, $hParent)
GUISetState(@SW_HIDE, $hChild)

While 1
    $iMsg = GUIGetMsg(1)
    Switch $iMsg[0]
        Case $GUI_EVENT_CLOSE
            Switch $iMsg[1]
                Case $hParent
                    Exit
                Case $hChild
                    GUISetState(@SW_HIDE, $hChild)
                    GUICtrlSetState($iShowTool, $GUI_ENABLE)
            EndSwitch
        Case $iShowTool
            GUISetState(@SW_SHOW, $hChild)
            GUICtrlSetState($iShowTool, $GUI_DISABLE)
    EndSwitch
WEnd

Cheers

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  

×