Je cherche un programme qui
-affiche une 2ième fenêtre (je sais faire)
-et qui ferme sur demande ($GUI_EVENT_CLOSE) cette 2ième fenêtre tout en laissant visible la 1ère (c'est là que je ne sais pas).
ci dessous exemple du code :
Programme Parent.au3
Code : Tout sélectionner
#Region ### START Koda GUI section ### Form=
$ParentWin = GUICreate(" Parent", 251, 307, 193, 125)
$Combo1 = GUICtrlCreateCombo("", 48, 64, 129, 25)
GUICtrlSetData(-1, "A|B|C|D|E")
$Combo2 = GUICtrlCreateCombo("", 48, 128, 129, 25)
GUICtrlSetData(-1, "1|2|3|4|5")
$Button1 = GUICtrlCreateButton("Button1", 72, 208, 81, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
$T=GUICtrlRead($Combo1)
$N=GUICtrlRead($Combo2)
;GUISwitch($parent2)
trans($T,$N)
EndSwitch
WEnd
Func trans($T,$N)
#include<Enf.au3>
EndFunc
Programme Enf.au3
Code : Tout sélectionner
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$parent2 = GUICreate("Enfant", 633, 447, 193, 125)
$Label1 = GUICtrlCreateLabel("Fenêtre enfant", 64, 48, 140, 34)
GUICtrlSetFont(-1, 14, 800, 0, "Papyrus")
GUICtrlSetColor(-1, 0xFF0000)
$Input1 = GUICtrlCreateInput("Input1", 56, 86, 137, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$M=$N & "-" & $T
GUICtrlSetData($Input1,$M)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
WinKill("[ACTIVE]", "")
GUISwitch($ParentWin)
EndSwitch
WEnd