Function Reference


_GUICtrlStatusBar_Create

Create a statusbar

#include <GuiStatusBar.au3>
_GUICtrlStatusBar_Create ( $hWnd [, $vPartEdge = -1 [, $vPartText = "" [, $iStyles = -1 [, $iExStyles = 0x00000000]]]] )

Parameters

$hWnd Handle to parent window
$vPartEdge [optional] Width of part or parts, for more than 1 part pass in 0-based array in the following format:
    $vPartEdge[0] - Right edge of part #1
    $vPartEdge[1] - Right edge of part #2
    $vPartEdge[n] - Right edge of part n
$vPartText [optional] Text of part or parts, for more than 1 part pass in 0-based array in the following format:
    $vPartText[0] - First part
    $vPartText[1] - Second part
    $vPartText[n] - Last part
$iStyles [optional] Control styles:
    $SBARS_SIZEGRIP - The status bar control will include a sizing grip at the right end of the status bar
    $SBARS_TOOLTIPS - The status bar will have tooltips

Forced: $WS_CHILD, $WS_VISIBLE
$iExStyles [optional] Control extended style. These correspond to the standard $WS_EX_* constants. See Extended Style Table.

Return Value

Success: the handle to the control.
Failure: 0.

Remarks

If using GUICtrlCreateMenu() then use _GUICtrlStatusBar_Create() after GUICtrlCreateMenu().

Related

_GUICtrlStatusBar_Destroy

Example

Example 1 : with Handle to GUI windows

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <Extras\WM_NOTIFY.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Global $g_idMemo, $g_hMainGUI, $g_hStatus

Example()

Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 400, 300)

        ; defaults to 1 part, no text
        $g_hStatus = _GUICtrlStatusBar_Create($hGUI)
        Local $aParts[3] = [75, 150, -1]
        _GUICtrlStatusBar_SetParts($g_hStatus, $aParts)

        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
        GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
        GUISetState(@SW_SHOW)

        MemoWrite("StatusBar Created with:" & @CRLF & _
                        @TAB & "Handle to GUI window" & @CRLF)

        _WM_NOTIFY_Register($g_idMemo)

        ; Get border sizes
        MemoWrite("Horizontal border width .: " & _GUICtrlStatusBar_GetBordersHorz($g_hStatus))
        MemoWrite("Vertical border width ...: " & _GUICtrlStatusBar_GetBordersVert($g_hStatus))
        MemoWrite("Width between rectangles : " & _GUICtrlStatusBar_GetBordersRect($g_hStatus))
        MemoWrite("")

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUISetState(@SW_ENABLE, $g_hMainGUI)
        GUIDelete($hGUI)
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage = "")
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
        #forceref $hWnd, $iMsg, $wParam

        Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
        Local $iCode = DllStructGetData($tNMHDR, "Code")
        Switch $hWndFrom
                Case $g_hStatus
                        Switch $iCode
                                Case $NM_CLICK ; The user has clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_CLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_DBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RCLICK ; The user has clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RCLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RDBLCLK ; The user has double-clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RDBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $SBN_SIMPLEMODECHANGE ; Simple mode changes
                                        _WM_NOTIFY_DebugEvent("$SBN_SIMPLEMODECHANGE", $tagNMHDR, $lParam, "hWndFrom,IDFrom")
                                ; No return value
                        EndSwitch
        EndSwitch
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Example 2 : with part width array of 3 elements

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <Extras\WM_NOTIFY.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Global $g_idMemo, $g_hMainGUI, $g_hStatus

Example()

Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 400, 300)

        ; sets parts with no text
        Local $aParts[3] = [75, 150, -1]
        $g_hStatus = _GUICtrlStatusBar_Create($hGUI, $aParts)
        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
        GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
        GUISetState(@SW_SHOW)

        MemoWrite("StatusBar Created with:" & @CRLF & _
                        @TAB & "Handle to GUI window" & @CRLF & _
                        @TAB & "part width array of 3 elements" & @CRLF)

        _WM_NOTIFY_Register($g_idMemo)

        ; Get border sizes
        MemoWrite("Horizontal border width .: " & _GUICtrlStatusBar_GetBordersHorz($g_hStatus))
        MemoWrite("Vertical border width ...: " & _GUICtrlStatusBar_GetBordersVert($g_hStatus))
        MemoWrite("Width between rectangles : " & _GUICtrlStatusBar_GetBordersRect($g_hStatus))
        MemoWrite("")

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUISetState(@SW_ENABLE, $g_hMainGUI)
        GUIDelete($hGUI)
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage = "")
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
        #forceref $hWnd, $iMsg, $wParam

        Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
        Local $iCode = DllStructGetData($tNMHDR, "Code")
        Switch $hWndFrom
                Case $g_hStatus
                        Switch $iCode
                                Case $NM_CLICK ; The user has clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_CLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_DBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RCLICK ; The user has clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RCLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RDBLCLK ; The user has double-clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RDBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $SBN_SIMPLEMODECHANGE ; Simple mode changes
                                        _WM_NOTIFY_DebugEvent("$SBN_SIMPLEMODECHANGE", $tagNMHDR, $lParam, "hWndFrom,IDFrom")
                                ; No return value
                        EndSwitch
        EndSwitch
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Example 3 : with Part array and Text array

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <Extras\WM_NOTIFY.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Global $g_idMemo, $g_hMainGUI, $g_hStatus

Example()

Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 400, 300)

        ;sets parts and text
        Local $aText[3] = ["Left Justified", @TAB & "Centered", @TAB & @TAB & "Right Justified"]
        Local $aParts[3] = [100, 175, -1]
        $g_hStatus = _GUICtrlStatusBar_Create($hGUI, $aParts, $aText)
        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
        GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
        GUISetState(@SW_SHOW)

        MemoWrite("StatusBar Created with:" & @CRLF & _
                        @TAB & "only Handle," & @CRLF & _
                        @TAB & "part width array of 3 elements" & @CRLF & _
                        @TAB & "part text array of 3 elements" & @CRLF)

        _WM_NOTIFY_Register($g_idMemo)

        ; Get border sizes
        MemoWrite("Horizontal border width .: " & _GUICtrlStatusBar_GetBordersHorz($g_hStatus))
        MemoWrite("Vertical border width ...: " & _GUICtrlStatusBar_GetBordersVert($g_hStatus))
        MemoWrite("Width between rectangles : " & _GUICtrlStatusBar_GetBordersRect($g_hStatus))
        MemoWrite("")

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUISetState(@SW_ENABLE, $g_hMainGUI)
        GUIDelete($hGUI)
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage = "")
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
        #forceref $hWnd, $iMsg, $wParam

        Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
        Local $iCode = DllStructGetData($tNMHDR, "Code")
        Switch $hWndFrom
                Case $g_hStatus
                        Switch $iCode
                                Case $NM_CLICK ; The user has clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_CLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_DBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RCLICK ; The user has clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RCLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RDBLCLK ; The user has double-clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RDBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $SBN_SIMPLEMODECHANGE ; Simple mode changes
                                        _WM_NOTIFY_DebugEvent("$SBN_SIMPLEMODECHANGE", $tagNMHDR, $lParam, "hWndFrom,IDFrom")
                                ; No return value
                        EndSwitch
        EndSwitch
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Example 4 : with Part with number and Text array

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <Extras\WM_NOTIFY.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Global $g_idMemo, $g_hMainGUI, $g_hStatus

Example()

Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 400, 300)

        ; will create part widths based on part size passed in
        Local $aText[3] = ["Left Justified", @TAB & "Centered", @TAB & @TAB & "Right Justified"]
        $g_hStatus = _GUICtrlStatusBar_Create($hGUI, 100, $aText)
        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
        GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
        GUISetState(@SW_SHOW)

        MemoWrite("StatusBar Created with:" & @CRLF & _
                        @TAB & "only Handle," & @CRLF & _
                        @TAB & "part width number" & @CRLF & _
                        @TAB & "part text array of 3 elements" & @CRLF)

        _WM_NOTIFY_Register($g_idMemo)

        ; Get border sizes
        MemoWrite("Horizontal border width .: " & _GUICtrlStatusBar_GetBordersHorz($g_hStatus))
        MemoWrite("Vertical border width ...: " & _GUICtrlStatusBar_GetBordersVert($g_hStatus))
        MemoWrite("Width between rectangles : " & _GUICtrlStatusBar_GetBordersRect($g_hStatus))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUISetState(@SW_ENABLE, $g_hMainGUI)
        GUIDelete($hGUI)
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage = "")
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
        #forceref $hWnd, $iMsg, $wParam

        Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
        Local $iCode = DllStructGetData($tNMHDR, "Code")
        Switch $hWndFrom
                Case $g_hStatus
                        Switch $iCode
                                Case $NM_CLICK ; The user has clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_CLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_DBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RCLICK ; The user has clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RCLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RDBLCLK ; The user has double-clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RDBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $SBN_SIMPLEMODECHANGE ; Simple mode changes
                                        _WM_NOTIFY_DebugEvent("$SBN_SIMPLEMODECHANGE", $tagNMHDR, $lParam, "hWndFrom,IDFrom")
                                ; No return value
                        EndSwitch
        EndSwitch
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Example 5 : with Part array and Text array with more elements

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <Extras\WM_NOTIFY.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Global $g_idMemo, $g_hMainGUI, $g_hStatus

Example()

Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 400, 300)

        ; adjusts array to largest array passed in (this time the text array is the largest)
        Local $aText[3] = ["Left Justified", @TAB & "Centered", @TAB & @TAB & "Right Justified"]
        Local $aParts[2] = [100, 175]
        $g_hStatus = _GUICtrlStatusBar_Create($hGUI, $aParts, $aText)
        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
        GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
        GUISetState(@SW_SHOW)

        MemoWrite("StatusBar Created with:" & @CRLF & _
                        @TAB & "only Handle," & @CRLF & _
                        @TAB & "part width array of 2 elements" & @CRLF & _
                        @TAB & "part text array of 3 elements" & @CRLF)

        _WM_NOTIFY_Register($g_idMemo)

        ; Get border sizes
        MemoWrite("Horizontal border width .: " & _GUICtrlStatusBar_GetBordersHorz($g_hStatus))
        MemoWrite("Vertical border width ...: " & _GUICtrlStatusBar_GetBordersVert($g_hStatus))
        MemoWrite("Width between rectangles : " & _GUICtrlStatusBar_GetBordersRect($g_hStatus))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUISetState(@SW_ENABLE, $g_hMainGUI)
        GUIDelete($hGUI)
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage = "")
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
        #forceref $hWnd, $iMsg, $wParam

        Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
        Local $iCode = DllStructGetData($tNMHDR, "Code")
        Switch $hWndFrom
                Case $g_hStatus
                        Switch $iCode
                                Case $NM_CLICK ; The user has clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_CLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_DBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RCLICK ; The user has clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RCLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RDBLCLK ; The user has double-clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RDBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $SBN_SIMPLEMODECHANGE ; Simple mode changes
                                        _WM_NOTIFY_DebugEvent("$SBN_SIMPLEMODECHANGE", $tagNMHDR, $lParam, "hWndFrom,IDFrom")
                                ; No return value
                        EndSwitch
        EndSwitch
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Example 6 : with Part array and Text array with LESS elements

#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <Extras\WM_NOTIFY.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

Global $g_idMemo, $g_hMainGUI, $g_hStatus

Example()

Func Example()
        ; Create GUI
        Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 400, 300)

        ; adjusts array to largest array passed in (this time the part width array)
        Local $aText[2] = ["Left Justified", @TAB & "Centered"]
        Local $aParts[3] = [100, 175, -1]
        $g_hStatus = _GUICtrlStatusBar_Create($hGUI, $aParts, $aText)
        ; Create memo control
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 274, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUICtrlSendMsg($g_idMemo, $EM_SETREADONLY, True, 0)
        GUICtrlSetBkColor($g_idMemo, 0xFFFFFF)
        GUISetState(@SW_SHOW)

        MemoWrite("StatusBar Created with:" & @CRLF & _
                        @TAB & "only Handle," & @CRLF & _
                        @TAB & "part width array of 3 elements" & @CRLF & _
                        @TAB & "part text array of 2 elements" & @CRLF)

        _WM_NOTIFY_Register($g_idMemo)

        ; Get border sizes
        MemoWrite("Horizontal border width .: " & _GUICtrlStatusBar_GetBordersHorz($g_hStatus))
        MemoWrite("Vertical border width ...: " & _GUICtrlStatusBar_GetBordersVert($g_hStatus))
        MemoWrite("Width between rectangles : " & _GUICtrlStatusBar_GetBordersRect($g_hStatus))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
        GUISetState(@SW_ENABLE, $g_hMainGUI)
        GUIDelete($hGUI)
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage = "")
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
        #forceref $hWnd, $iMsg, $wParam

        Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        Local $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
        Local $iCode = DllStructGetData($tNMHDR, "Code")
        Switch $hWndFrom
                Case $g_hStatus
                        Switch $iCode
                                Case $NM_CLICK ; The user has clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_CLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_DBLCLK ; The user has double-clicked the left mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_DBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RCLICK ; The user has clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RCLICK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $NM_RDBLCLK ; The user has double-clicked the right mouse button within the control
                                        _WM_NOTIFY_DebugEvent("$NM_RDBLCLK", $tagNMMOUSE, $lParam, "IDFrom,,ItemSpec,ItemData,X,Y,HitInfo")
                                        Return True ; indicate that the mouse click was handled and suppress default processing by the system
                                        ; Return FALSE ;to allow default processing of the click.
                                Case $SBN_SIMPLEMODECHANGE ; Simple mode changes
                                        _WM_NOTIFY_DebugEvent("$SBN_SIMPLEMODECHANGE", $tagNMHDR, $lParam, "hWndFrom,IDFrom")
                                ; No return value
                        EndSwitch
        EndSwitch
        Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY