Jump to content

The GUI and the Script don't answer


djbj90
 Share

Recommended Posts

Hello guys, i'm new to autoIt and I have a problem with Gui's

I have 3 Scripts :

Script1

#include <GUIConstantsEx.au3>


$GUI = GUICreate("Window 1",300, 300, 0)
$EQUILABEL = GUICtrlCreateLabel("Hello !", 100, 100, 50)
GUISetState(@SW_SHOW)


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

Script2

#include <GUIConstantsEx.au3>


$GUI = GUICreate("Window 2", 300, 300, 300)
$EQUILABEL = GUICtrlCreateLabel("Hello !", 100, 100, 50)
GUISetState(@SW_SHOW)


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

Script3

#include <GUIConstantsEx.au3>

        $Script1 = Run(@ScriptDir & "\Script1.exe", @ScriptDir)
    $Script2 = Run(@ScriptDir & "\Script2.exe", @ScriptDir)
    Sleep(500)

        $GUI = GUICreate("Manage Scripts", 300, 300, @DesktopWidth - 450)

    $LABELSCRIPT1 = GUICtrlCreateLabel("Script1", 40, 100, 50)
    $SHOWSCRIPT1 = GUICtrlCreateButton("Show", 15, 120, 50, 30)
    $HIDESCRIPT1 = GUICtrlCreateButton("Hide", 65, 120, 50, 30)

    $LABELSCRIPT2 = GUICtrlCreateLabel("Script2", 205, 100, 50)
    $SHOWSCRIPT2 = GUICtrlCreateButton("Show", 175, 120, 50, 30)
    $HIDESCRIPT2 = GUICtrlCreateButton("Hide", 225, 120, 50, 30)


    GUISetState(@SW_SHOW)


    While 1
        $NMSG = GUIGetMsg()
        Switch $NMSG
            Case $GUI_EVENT_CLOSE
                Exit
            Case $SHOWSCRIPT1
                $WINDOW = GETHWNDFROMPID($Script1)
                WinSetState($WINDOW, "", @SW_SHOW)

            Case $HIDESCRIPT1
                $WINDOW = GETHWNDFROMPID($Script1)
                WinSetState($WINDOW, "", @SW_HIDE)

            Case $SHOWSCRIPT2
                $WINDOW = GETHWNDFROMPID($Script2)
                WinSetState($WINDOW, "", @SW_SHOW)

            Case $HIDESCRIPT2
                $WINDOW = GETHWNDFROMPID($Script2)
                WinSetState($WINDOW, "", @SW_HIDE)


        EndSwitch
    WEnd

-Script1 and Script2 make 2 windows with "Hello" in them.

-Script3 make a windows, with buttons for show/hide the Script1 and Script2 windows.

So i run the 3rd script, and i can show/hide the others.

But there is something i doesn't understand, if i do this:

1)Show the script1

2)Close it by his red cross

3)Show the script1 (doesn't work, normal)

If i do this, my 3rd script doesn't give response, and the window is frozen, i can't close it with red cross.

There is a solution for solve it ?

Thanks for answers.

Edited by djbj90
Link to comment
Share on other sites

  • Moderators

djbj90,

I see you did not read those rules very well. I take it you did not see the one which reads: :huh:

"Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above"

Do NOT start a third thread. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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