Mit _GUICtrlStatusBar_EmbedControl(...) eingebettete Controls verschwinden nach Minimieren

    • Offizieller Beitrag

    Keine Ahnung warum die Control nicht mehr richtig angezeigt werden, aber hier hast du einen Fix:

    Spoiler anzeigen
    [autoit]

    #Region - Timestamp
    ; 2013-01-06 18:07:13
    #EndRegion

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <ProgressConstants.au3>
    #include <SendMessage.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Debug_SB = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work

    [/autoit] [autoit][/autoit] [autoit]

    _Main()

    [/autoit] [autoit][/autoit] [autoit]

    Func _Main()

    [/autoit] [autoit][/autoit] [autoit]

    Local $hGUI, $hProgress, $hInput, $input, $progress, $hStatus
    Local $aParts[4] = [80, 160, 300, -1]

    [/autoit] [autoit][/autoit] [autoit]

    ; Create GUI
    $hGUI = GUICreate("StatusBar Embed Control", 400, 300)

    [/autoit] [autoit][/autoit] [autoit]

    ;===============================================================================
    ; defaults to 1 part, no text
    $hStatus = _GUICtrlStatusBar_Create($hGUI)
    _GUICtrlStatusBar_SetMinHeight($hStatus, 20)

    [/autoit] [autoit][/autoit] [autoit]

    ;===============================================================================
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    ; Initialize parts
    _GUICtrlStatusBar_SetParts($hStatus, $aParts)
    _GUICtrlStatusBar_SetText($hStatus, "Part 1")
    _GUICtrlStatusBar_SetText($hStatus, "Part 2", 1)

    [/autoit] [autoit][/autoit] [autoit]

    ; Embed a progress bar
    If @OSType = "WIN32_WINDOWS" Then
    $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH)
    $hProgress = GUICtrlGetHandle($progress)
    _GUICtrlStatusBar_EmbedControl($hStatus, 2, $hProgress)
    Else
    $progress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_MARQUEE) ; marquee works on Win XP and above
    $hProgress = GUICtrlGetHandle($progress)
    _GUICtrlStatusBar_EmbedControl($hStatus, 2, $hProgress)
    _SendMessage($hProgress, $PBM_SETMARQUEE, True, 200) ; marquee works on Win XP and above
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    $input = GUICtrlCreateInput("This is Embeded", 0, 0)
    $hInput = GUICtrlGetHandle($input)
    _GUICtrlStatusBar_EmbedControl($hStatus, 3, $hInput, 3)

    [/autoit] [autoit][/autoit] [autoit]

    ; Loop until user exits
    While 1

    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_RESTORE
    _GUICtrlStatusBar_EmbedControl($hStatus, 2, $hProgress)
    _GUICtrlStatusBar_EmbedControl($hStatus, 3, $hInput, 3)
    Case $GUI_EVENT_CLOSE
    ExitLoop
    EndSwitch
    WEnd
    GUIDelete()
    EndFunc ;==>_Main

    [/autoit]


    Scheinbar müssen die Controls nach einem Restore immer neu gesetzt werde.