Hallo Autoit Gemeinde,
hab mal wieder ein Problem mit dem ich nicht so recht weiter komme.
Ich möchte in einem Parent Fenster zwei weitere Child Fenster anzeigen. Das erste soll nur eine Anzeige des
"DiskMgmt.msc" sein, das zweite Fenster soll ein Fenster für bestimmte Aufgaben sein.
Das klappt auch halbwegs, jedoch habe ich das Problem in dem 2.ten Child Fenster den Button anzusprechen.
GUIEVENTCLOSE funktioniert, jedoch Case Button nicht.
Muß noch dazu sagen das ich mich mit WinAPUI n.n. so gut auskenne.
Würde mich freuen wenn mal jemand darüber schauen könnte und mir einen Tipp gibt.
Danke
Spoiler anzeigen
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
;~ #include <debugger.au3>
#RequireAdmin
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
GUICreate("Test", 200, 100, Default, Default) ;, $WS_POPUPWINDOW)
GUISetState(@SW_SHOW)
; *********************************************************************************************************************************************
$hParent = GUICreate("_WinAPI_SetParent", 950, 800, Default, Default, BitOR($WS_CAPTION, $WS_SYSMENU, $WS_CLIPCHILDREN))
GUISetState()
$sCommand = 'Diskmgmt.msc'
Local $iPID, $sOutput = ""
$iPID = Run('"' & @ComSpec & '" /c ' & $sCommand, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
ProcessWaitClose($iPID)
WinWait("[CLASS:MMCMainFrame]")
$hChild = WinGetHandle("[CLASS:MMCMainFrame]")
_WinAPI_SetParent($hChild, $hParent)
WinMove($hChild, "", 0, 0, 950);, 400) ; an 0,0 des Hauptfensters schieben
WinSetState($hChild, "", @SW_SHOW)
WinSetState($hChild, "", @SW_DISABLE)
; *********************************************************************************************************************************************
$hChild1 = GUICreate("_WinAPI_SetChild", 900, 200, Default, 100, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_SYSMENU, $WS_CLIPCHILDREN))
Global $Button = GUICtrlCreateButton('TEST', 100, 100, 50, 50)
_WinAPI_SetParent($hChild1, $hParent)
_WinAPI_SetWindowLong($hChild1, $GWL_STYLE, $WS_OVERLAPPEDWINDOW) ;BitOR($WS_CHILD, $WS_BORDER, $WS_POPUP))
WinMove($hChild1, "", 0, 455, 950, 345) ; an 0,0 des Hauptfensters schieben
$hChild1 = WinGetHandle($hChild1)
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $hChild1 = ' & $hChild1 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
If @error Then
MsgBox($MB_SYSTEMMODAL, "", "An error occurred when trying to retrieve the window handle of Notepad.")
Exit
EndIf
WinSetState($hChild1, "", @SW_ENABLE)
WinSetState($hChild1, "", @SW_SHOW)
While 1
$idMsg = GUIGetMsg()
Select
Case $idMsg = $GUI_EVENT_CLOSE
MsgBox($MB_SYSTEMMODAL, "", "Dialog was closed")
Exitloop
Case $idMsg = $GUI_EVENT_MINIMIZE
MsgBox($MB_SYSTEMMODAL, "", "Dialog minimized", 2)
Case $idMsg = $GUI_EVENT_MAXIMIZE
MsgBox($MB_SYSTEMMODAL, "", "Dialog restored", 2)
Case $idMsg = $button
MsgBox($MB_SYSTEMMODAL, "", "Dialog -1- was closed")
Exitloop
EndSelect
WEnd
GUIDelete()