函数参考


_GUICtrlStatusBar_Destroy

删除控件

#Include <GuiStatusBar.au3>
_GUICtrlStatusBar_Destroy(ByRef $hWnd)

参数

$hWnd 控件句柄

返回值

成功: 返回 True, 句柄设置为 0
失败: 返回 False

注意/说明

Restricted to only be used on StatusBar created with _GUICtrlStatusBar_Create
仅限于用在状态栏创建_GUICtrlStatusBar_Create

相关

_GUICtrlStatusBar_Create

示例/演示


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

$Debug_SB = False ; 检查传递给函数的类名, 设置为True并输出到一个控件的句柄,用于检查它是否工作

_Main()

Func _Main()

    Local $hGUI, $HandleBefore, $hStatus
    Local $aParts[3] = [75, 150, -1]

    ; 创建 GUI
    $hGUI = GUICreate("StatusBar Destroy", 400, 300)

    ;===============================================================================
    ; defaults to 1 part, no text
    $hStatus = _GUICtrlStatusBar_Create($hGUI)
    ;===============================================================================
    _GUICtrlStatusBar_SetParts($hStatus, $aParts)

    GUISetState()

    $HandleBefore = $hStatus
    MsgBox(4160, "信息", "Destroying the Control for Handle: " & $hStatus)
    MsgBox(4160, "信息", "Control Destroyed: " & _GUICtrlStatusBar_Destroy($hStatus) & @LF & _
            "Handel Before Destroy: " & $HandleBefore & @LF & _
            "Handle After Destroy: " & $hStatus)

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main