Jump to content
Sign in to follow this  
DirtDBaK

Use of Multiple GUI's inside of a parent <new example!>

Tell me what you think...  

9 members have voted

  1. 1. Is this Helpful/Useful?

    • Yes
      6
    • No
      3


Recommended Posts

DirtDBaK

#include <GUIConstants.au3>
$big = GuiCreate( "big", 988,748, -1, -1 )
GUISetState()
$inside = GuiCreate( "1", 982, 200, 0, 0, Default, $WS_EX_TOOLWINDOW )
GUISetState()
$inside2 = GuiCreate( "2", 538, 200, 0, 222, Default, $WS_EX_TOOLWINDOW )
GUISetState()
;$inside3 = GuiCreate( "3", 982, 275, 0, 445, Default, $WS_EX_TOOLWINDOW )
;GUISetState()
_SetParent( "1", "big" )
_SetParent( "2", "big" )

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

#cs ----------------------------------------------------------------------------
   
    AutoIt Version: 3.2.4.9
    Author:         Senton-Bomb
   
        $TitleP: The title of the parent window
        $TitleC: The title of the child window
       
        If a window doesn't exist, It returns -1, otherwise it returns 1
   
    Script Function:
    Wrapper for the "SetParent" dllcall + Example.
   
#ce ----------------------------------------------------------------------------

; Script Stizzle - Add your codeizzle

Func _SetParent($TitleP, $TitleC)
    If WinExists($TitleP) Then
        If WinExists($TitleC) Then
            $HwndP = WinGetHandle($TitleP)
            $HwndC = WinGetHandle($TitleC)
            $user32 = DllOpen("user32.dll")
            DllCall($user32, "str", "SetParent", "HWnd", $HwndP, "HWnd", $HwndC)
            DllClose( $user32 )
            Return 1
        Else
            Return -1
        EndIf
    Else
        Return -1
    EndIf
EndFunc   ;==>_SetParentoÝ÷ Ù±bÅçB=C롹^h­9e
Z,{MúºÇ«ß`uçZÁ¬­¢h§h³y©Ý­ë-¢·°whÂÇë¢kaxǧ¸«5ç¶è­i@Åý¶®¶­sb6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC°¢6æ6ÇVFRfÇC´uTÆ7GfWræS2fwC°¢b33c¶&rÒwV7&VFRgV÷C¶&rgV÷C²ÂÂcÂÓÂÓ¤uT6WD&´6öÆ÷"fb¢b33c·æVÇ2ÒuT7G&Ä7&VFTÖVçRb33´7FfRvæF÷w2b33²´5$TDU2DRÔTåP¢b33c·7G&ÄÒuT7G&Ä7&VFTÖVçTFVÒgV÷C´wVgV÷C²Âb33c·æVÇ2´ÔTåRDTÒdõ"uTôäP¤uT7G&Å6WE7FFRÓÂb33c´uTô4T4´TB´6V6²B6æ6RBvÆÂ&R6÷và¢b33c·vãÒb33µ6÷rb33²µ6WBFRf"Fò6FBBb33·26÷væp¢µ&WVBF2f÷"FR÷FW"wV¢b33c·7G&ÄÒuT7G&Ä7&VFTÖVçTFVÒgV÷CµvæF÷r"gV÷C²Âb33c·æVÇ2¤uT7G&Å6WE7FFRÓÂb33c´uTô4T4´TB¢b33c·vã"Òb33µ6÷rb33°¤uT6WE7FFR´B2Fò&R6÷vâ5uõ4õr7FFR6òFBõ6WE&VçBvÆÂv÷&°¢b33c¶ç6FRÒwV7&VFRgV÷C´uTgV÷C²ÂS#2Â#bÂÂÂ&F÷"b33cµu5ô4Ä4$Ääu2Âb33cµu5õ4¤T$õÂb33cµu5ôUõDôôÅtäDõr²5$TDRuT¤uT6WD&´6öÆ÷"fffffb¤vÆö&Âb33cµ6ÆFW#ÒuT7G&Ä7&VFU6ÆFW"ÂS"ÂS"ÂCRÂÓÂ&"b33cµu5ôUô4ÄTåDTDtRÂb33cµu5ôUõ5DD4TDtR²DBÄEDÄR4ôåE$ôÂââà¤uT7G&Å6WD&´6öÆ÷"ÓÂfb¤uT7G&Å6WD6öÆ÷"ÓÂfc¤uT6WE7FFR5uõ4õr¢b33c¶ç6FS"ÒwV7&VFRgV÷CµvæF÷r"gV÷C²ÂS3Â#RÂÂ##"Âb33cµu5õ4¤T$õÂb33cµu5ôUõDôôÅtäDõr²DBuT"¤uT6WD&´6öÆ÷"&cff¤uT6WE7FFR5uõ4õr   ¥õ6WE&VçBgV÷C´uTgV÷C²ÂgV÷C¶&rgV÷C²µ4UBDTÒ$õDDò$R4ÄBtà¥õ6WE&VçBgV÷CµvæF÷r"gV÷C²ÂgV÷C¶&rgV÷C²µ4UBDTÒ$õDDò$R4ÄBtà  ¥vÆR¢b33c¶ä×6rÒuTvWD×6r¢7vF6b33c¶ä×6p¢66Rb33c´uTôUdTåEô4Äõ4P¢W@¢VæE7vF6¢¢bb33c·7G&ÄÒb33c¶ä×6rFVà¢bb33c·vãÒb33µ6÷rb33²FVâ¢uT6WE7FFR5uôDRÂb33c¶ç6FR¢uT7G&Å6WE7FFRb33c·7G&ÄÂb33c´uTõTä4T4´TB¢b33c·vãÒb33´FRb33°¢VÇ6P¢uT6WE7FFR5uõ4õrÂb33c¶ç6FR¢uT7G&Å6WE7FFRb33c·7G&ÄÂb33c´uTô4T4´TB¢b33c·vãÒb33µ6÷rb33°¢VæF`¢VæF`¢bb33c·7G&ÄÒb33c¶ä×6rFVà¢bb33c·vã"Òb33µ6÷rb33²FVâ¢uT6WE7FFR5uôDRÂb33c¶ç6FS"¢uT7G&Å6WE7FFRb33c·7G&ÄÂb33c´uTõTä4T4´TB¢b33c·vã"Òb33´FRb33°¢VÇ6P¢uT6WE7FFR5uõ4õrÂb33c¶ç6FS"¢uT7G&Å6WE7FFRb33c·7G&ÄÂb33c´uTô4T4´TB¢b33c·vã"Òb33µ6÷rb33°¢VæF`¢VæF`¢¥tVæ@         ¤gVæ2õ6WE&VçBb33cµFFÆUÂb33cµFFÆT2¢bväW7G2b33cµFFÆUFVà¢bväW7G2b33cµFFÆT2FVà¢b33c´væEÒvävWDæFÆRb33cµFFÆU¢b33c´væD2ÒvävWDæFÆRb33cµFFÆT2¢b33c·W6W#3"ÒFÆÄ÷VâgV÷C·W6W#3"æFÆÂgV÷C²¢FÆÄ6ÆÂb33c·W6W#3"ÂgV÷C·7G"gV÷C²ÂgV÷Cµ6WE&VçBgV÷C²ÂgV÷C´væBgV÷C²Âb33c´væEÂgV÷C´væBgV÷C²Âb33c´væD2¢FÆÄ6Æ÷6Rb33c·W6W#3"¢&WGW&â¢VÇ6P¢&WGW&âÓ¢VæD`¢VÇ6P¢&WGW&âÓ¢VæD`¤VæDgVæ2³ÓÒfwCµõ6WE&Vç

Edited by DBak

[center][/center]

Share this post


Link to post
Share on other sites
Valuater

Fix the

While 1

WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
BrettF

I do believe your code is inncorrect?

#include <GUIConstants.au3>
$big = GuiCreate( "Big Win", 988,748, -1, -1 )
GUISetState()
$inside = GuiCreate( "1", 982, 200, 0, 0, Default, $WS_EX_TOOLWINDOW )
GUISetState()
$inside2 = GuiCreate( "2", 538, 200, 0, 222, Default, $WS_EX_TOOLWINDOW )
GUISetState()
_SetParent( "Inside Window", "Big Win" )
_SetParent( "shit", "Big Win" )

While 1
WEnd

Should be:

#include <GUIConstants.au3>
$big = GUICreate("Big Win", 988, 748, -1, -1)
GUISetState()
$inside = GUICreate("1", 982, 200, 0, 0, Default, $WS_EX_TOOLWINDOW)
GUISetState()
$inside2 = GUICreate("2", 538, 200, 0, 222, Default, $WS_EX_TOOLWINDOW)
GUISetState()
_SetParent ("1", "Big Win")
_SetParent ("2", "Big Win")

While 1
    Sleep(100)
WEnd

Share this post


Link to post
Share on other sites
DirtDBaK

problems... The gui wont change color like it's susposed to... is it my bug???

#include <GUIConstants.au3>
$big = GuiCreate( "Big Win", 988,748, -1, -1 )
GUISetBkColor( 0x000000 )
GUISetState()
$inside = GuiCreate( "1", 982, 200, 0, 0, Default, $WS_EX_TOOLWINDOW )
GUISetBkColor( 0xff0000 )
GUISetState()
$list = GuiCreate( "2", 538, 200, 0, 222, Default, $WS_EX_TOOLWINDOW )
GUISetBkColor( 0xffffff, $list )
GUISetBkColor( 0xffffff )
GUISetState()
$inside3 = GuiCreate( "3", 982, 275, 0, 445, Default, $WS_EX_TOOLWINDOW )
GUISetBkColor( 0x000000 )
GUISetState()
_SetParent( "1", "Big Win" )
_SetParent( "2", "Big Win" )
_SetParent( "3", "Big Win" )


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

#cs ----------------------------------------------------------------------------
   
    AutoIt Version: 3.2.4.9
    Author:         Senton-Bomb
   
        $TitleP: The title of the parent window
        $TitleC: The title of the child window
       
        If a window doesn't exist, It returns -1, otherwise it returns 1
   
    Script Function:
    Wrapper for the "SetParent" dllcall + Example.
   
#ce ----------------------------------------------------------------------------

; Script Stizzle - Add your codeizzle

Func _SetParent($TitleP, $TitleC)
    If WinExists($TitleP) Then
        If WinExists($TitleC) Then
            $HwndP = WinGetHandle($TitleP)
            $HwndC = WinGetHandle($TitleC)
            $user32 = DllOpen("user32.dll")
            DllCall($user32, "str", "SetParent", "HWnd", $HwndP, "HWnd", $HwndC)
            DllClose( $user32 )
            Return 1
        Else
            Return -1
        EndIf
    Else
        Return -1
    EndIf
EndFunc   ;==>_SetParent

[center][/center]

Share this post


Link to post
Share on other sites
BrettF

This was correct for me... (i changed the colours to be more "interesting")

#include <GUIConstants.au3>
$big = GuiCreate( "Big Win", 988,748, -1, -1 )
GUISetBkColor( 0xFFFFFF )
GUISetState()
$inside = GuiCreate( "1", 982, 200, 0, 0, Default, $WS_EX_TOOLWINDOW )
GUISetBkColor( 0xff0000 )
GUISetState()
$list = GuiCreate( "2", 538, 200, 0, 222, Default, $WS_EX_TOOLWINDOW )
GUISetBkColor( 0xe9e9e9, $list )
GUISetBkColor( 0xe9e9e9 )
GUISetState()
$inside3 = GuiCreate( "3", 982, 275, 0, 445, Default, $WS_EX_TOOLWINDOW )
GUISetBkColor( 0x999999 )
GUISetState()
_SetParent( "1", "Big Win" )
_SetParent( "2", "Big Win" )
_SetParent( "3", "Big Win" )


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

#cs ----------------------------------------------------------------------------
   
    AutoIt Version: 3.2.4.9
    Author:      Senton-Bomb
   
        $TitleP: The title of the parent window
        $TitleC: The title of the child window
       
        If a window doesn't exist, It returns -1, otherwise it returns 1
   
    Script Function:
    Wrapper for the "SetParent" dllcall + Example.
   
#ce ----------------------------------------------------------------------------

; Script Stizzle - Add your codeizzle

Func _SetParent($TitleP, $TitleC)
    If WinExists($TitleP) Then
        If WinExists($TitleC) Then
            $HwndP = WinGetHandle($TitleP)
            $HwndC = WinGetHandle($TitleC)
            $user32 = DllOpen("user32.dll")
            DllCall($user32, "str", "SetParent", "HWnd", $HwndP, "HWnd", $HwndC)
            DllClose( $user32 )
            Return 1
        Else
            Return -1
        EndIf
    Else
        Return -1
    EndIf
EndFunc  ;==>_SetParent

Share this post


Link to post
Share on other sites
gseller

I like Bert's More vivid colors.. LOL Helps discern the little children.. <_<

Share this post


Link to post
Share on other sites
Xand3r

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
        Case $GUI_EVENT_CLOSE
            If $nMsg[1]=$big Then 
                Exit
            Else
                GUIDelete($nMsg[1])
            EndIf
    EndSwitch
WEnd

Try this loop so when you try to close the child windows the program won't exit, just delete the child window


Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

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  

×