Jump to content

2 GuiCreate /include - but not close the include Gui .


Recommended Posts

Hello all ...

I have another problem that I dont now how to resolve it ...

My exemple cod is ..

#include <GUIConstants.au3>

GUICreate("test",500, 500)

MSgbox(0,"ss","test exit include gui")

#include<testgui2.au3>

MSgbox(0,"ss","done now can exit ")

While 1

WEnd

In include au3 file is another Gui Win that look like this code but ,, in my tests i not fine any that make the include gui win to close itself .. and continue to the finish msgbox primarri win gui ... name "test" ,,,

Exist somthink that make the Gui window from include file to close itself ..and continue runing the main gui window ..?

Thanks ....

Link to comment
Share on other sites

still wait to close manul , and not display the main gui win... I not know how to do ....

sorry in main gui win I have

GuiSetState()
Do 
    $msg = GUIGetMsg() 
    Select
;-----Stufff-----
    EndSelect

Until $msg = $GUI_EVENT_CLOSE

and in include file i have "while" but now i try and with no while ,,, stiil not work ..

just to close automatic the include file gui window and display the main guy ..

Edited by GameIDevelp
Link to comment
Share on other sites

It's a bad practice to put #include in the middle of a script to execute code.

#include "testgui2.au3" should go at the top of your script, and the code to show your second GUI should be exposed by a function.

If you only have one GUI, then you don't really need the handle returned by GUICreate, but it is vital with multiple GUIs unless you're using event mode.

Take a look at the help file example for GUISwitch.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

I look at gui exemple for child ... now i use a similar code ,, but my parent "main" gui not worck .. any button not work .. but worck include window to close and show the main gui ...

why i can not use the main gui afte close the include gui window .. ?

my code .

#include <GuiConstants.au3>

Global $IniFile

$main = GuiCreate("main gui", 300, 120)
GUISetState(@SW_SHOW)

$but = GUICtrlCreateButton("test button",10,10,200,20)

#include <secondgui-child.au3>
GUISetState(@SW_SHOW)

GuiSetState()
Do 
    $msg = GUIGetMsg(1) 
    Select
        Case $msg[0] = $GUI_EVENT_CLOSE
         If $msg[1] = $child Then
            GUISwitch($child)
            GUIDelete()
         ElseIf $msg[1] = $main Then
            GUISwitch($main)
            GUIDelete()
         
            Exit
         EndIf
   case $msg = $but
            msgbox(0,"ddd","ddd")
    EndSelect

Until $msg = $GUI_EVENT_CLOSE

and include file ......

#include-once

#include <GUIConstants.au3>

$child = GuiCreate("child gui", 300, 120)
GUISetState(@SW_SHOW)

if $test=0 then
endIF
---my content ---- without "GuiSetState()" or while ..

i not know why the main gui not worck the button ..... can anyone help me , please ? ...

Link to comment
Share on other sites

,,ohhh ,, this problem it take me I think more that 2 days ,, i need to finish my project .. i not know how to resolve this problem I think imposible problem for me , tiny problem for big guys that know autoit ... i need this to make it worck i not know another way,,, i can progress with my projects untill i resolve this .. . .. Who to ask ,, who to pay for help ,I wanna to pay somebody to make and for me , 1 exemple with 2 "gui" that worck all buttons on it and close 1 win at time and still worck all buttons ,... please .. ? ,,

exist areas in this forum where is paypable service .. ?i hop to not delay another days .,,., .. :D

Link to comment
Share on other sites

Why do you have to include other file while you can do it in the same file?

If you want to show/hide the second GUI with included file then create 2 function _CreateChildGui() and _DeleteChildGui() in the included file then in the main file you just call it to show/hide.

And addition, You should use opt(OnEventMode) for your GUI.

Also

$main = GuiCreate("main gui", 300, 120)
GUISetState(@SW_SHOW)

$but = GUICtrlCreateButton("test button",10,10,200,20)oÝ÷ ØayºÚ"µÍÌÍÛXZ[HÝZPÜX]J    ][ÝÛXZ[ÝZI][ÝËÌL
BÌÍØ]HÕRPÝÜX]P]Û ][ÝÝÝ]Û][ÝËLL
BÕRTÙ]Ý]JÕ×ÔÒÕÊ

is better

exist areas in this forum where is paypable service .. ?i hop to not delay another days .,,., ..

Autoit is free. If you want to help community then you can donate. Don't try to push.
UnderWorldVN- Just play the way you like it
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...