Skript
#include <GUIConstants.au3>
;******************** M A I N W I N D O W *************************
$MainWindow=GUICreate('Graphics',230,450)
GUISetBkColor(0x2058E1)
$tab=GUICtrlCreateTab (10,10, 210,410)
$tab0=GUICtrlCreateTabItem ('Palette')
GUICtrlSetState(-1,$GUI_SHOW)
GUICtrlCreateGroup ('ArtIcons',20,40,190,90)
GUICtrlCreateLabel ('Copy colors from one palette to another', 25,60,170,70)
$MWBtn1=GUICtrlCreateButton ('', 175,95,32,32,$BS_ICON)
GUICtrlSetImage (-1, "shell32.dll",21)
GUICtrlSetTip(-1,'Export palette')
GUICtrlSetFont (-1,8.5, 400, -1, 'Arial')
GUICtrlCreateGroup ("Corel Drawn",20,145,190,70)
GUICtrlCreateLabel ('Export palette from ArtIcon to Corel Drawn', 25,160,170,70)
$MWBtn2 = GUICtrlCreateButton ('', 175,180,32,32,$BS_ICON)
GUICtrlSetTip(-1,'Export palette')
GUICtrlSetImage (-1, "shell32.dll",21)
$SBConfig=GUICtrlCreateTabItem ( 'Configuration')
GUICtrlCreateTabItem ('') ; end tabitem definition
;************* S E C O N D W I N D O W (Assistent) *****************
$Assistent1 = GUICreate('Assistent', 405, 280, -1, -1,$WS_EX_TOPMOST)
GUICtrlCreateLabel('',0, 0,400,40,$SS_SUNKEN)
GUICtrlSetBkColor(-1,0xFFFFFF)
$otxt1=GUICtrlCreateLabel('Excercise 1',10,5, 350,20)
GUICtrlSetFont (-1,10,900,1,'Arial')
GUICtrlSetBkColor(-1,0xFFFFFF)
$otxt2=GUICtrlCreateLabel('Describtion 1',15,20, 350,20)
GUICtrlSetFont (-1,9,400,1,'Arial')
GUICtrlSetBkColor(-1,0xFFFFFF)
GUICtrlCreateLabel('',1,40,398,174,$SS_SUNKEN)
Local $utxt=GUICtrlCreateLabel('Explaination' & @CRLF & __
@CRLF & 'Some text' & @CRLF & @CRLF & 'Source: '& @CRLF & __
@CRLF & 'Some Text.' & @CRLF & @CRLF & 'Destination: ',15, 55, 370,145)
$Input1 = GUICtrlCreateInput ( '', 80, 107, 250, 20)
$Input2 = GUICtrlCreateInput ( '',80, 152,250, 20)
$Fort = GUICtrlCreateProgress (15,175,370,10,$PBS_SMOOTH)
GUICtrlSetState(-1,$GUI_HIDE)
GUICtrlCreateLabel('',1, 214,400,2,$SS_SUNKEN)
$BtnBack=GUICtrlCreateButton ( 'Back', 205, 220, 60, 24,-1 )
GUICtrlSetTip ( -1, 'Back' )
GUICtrlSetState(-1,$GUI_DISABLE)
$BtnCONTINUE=GUICtrlCreateButton ( 'Continue', 270, 220, 60, 24,-1 )
GUICtrlSetTip ( -1, 'Continue' )
$BtnCANCEL=GUICtrlCreateButton ( 'Cancel', 335, 220, 60, 24 ,-1)
GUICtrlSetTip ( -1, 'Cancel' )
GUISwitch($MainWindow)
GUISetState ()
;*********************** R U N T I M E *********************
While 1
$msg = GUIGetMsg(1)
Select
Case $msg[0]=$MWBtn1
MsgBox(4096, "GUI Event", "You clicked MainWindow Button1" & __
@CRLF & "Call assistent for copying colors",5)
GUISwitch($Assistent1)
GUISetState()
Case $msg[0]=$BtnBACK
MsgBox(4096, "GUI Event", "You clicked AssistentWindow Button BACK",5)
Case $msg[0]=$BtnCONTINUE
MsgBox(4096, "GUI Event", "You clicked AssistentWindow Button CONTINUE",5)
_Continue1()
;?????????????????????????? Q U E S T I O N ?????????????????????????????????????????
Case $MSG[0]=$BTNCANCEL ;THIS IS MY PROBLEM: HOW TO CLOSE ASSISTENT AND HOW RETURN TO MAINWINDOW ??????????????????
MsgBox(4096, "GUI EVENT", "YOU CLICKED ASSISTENTWINDOW BUTTON CANCEL",5)
GUISwitch($MAINWINDOW)
GUISetState()
;Is there another solution than GUISETSTATE($Assistent1,$GUI_HIDE) and GUISETSTATE($Assistent1,$GUI_SHOW)?
;?????????????????????????? Q U E S T I O N ?????????????????????????????????????????
Case $msg[0]= $GUI_EVENT_CLOSE And $msg[1]=$MainWindow
MsgBox(4096, "GUI Event", "You clicked X and $GUI_EVENT_CLOSE of MainWindow")
ExitLoop
Case $msg[0]= $GUI_EVENT_CLOSE And $msg[1]=$Assistent1
MsgBox(4096, "GUI Event", "You clicked AssistentWindow Button CANCEL")
EndSelect
WEnd
;*********************** F U N C T I O N S *********************
Func _Continue1()
GUICtrlSetState($BtnCONTINUE,$GUI_ENABLE)
GUICtrlSetState($Input1,$GUI_HIDE)
GUICtrlSetState($Input2,$GUI_HIDE)
GUICtrlSetData($BtnCONTINUE,'Retry')
GUICtrlSetData($BtnCANCEL,'Finish')
GUICtrlSetData($otxt1,'Excercise 2')
GUICtrlSetData($utxt,'Highlight the range of colors')
EndFunc