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, @error can be set (see remark).

Remarks

If $hWnd referenced Window is not in the same process, the @error is set to 4.

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

Related

_GUICtrlStatusBar_Destroy

Example

Example 1 : with Handle to GUI windows

#include "Extras\HelpFileInternals.au3"
#include "Extras\WM_NOTIFY.au3"

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

Global $g_hStatus

Example()

Func Example()
    ; Create GUI
    Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 450, 320, 100, 100)

    ; defaults to 1 part, no text
    Local $hStatus = _GUICtrlStatusBar_Create($hGUI)
    $g_hStatus = $hStatus

    ; Create memo control
    _MemoCreate(2, 8, 444, 259)

    GUISetState(@SW_SHOW)

    Local $aParts[3] = [75, 150, -1]
    _GUICtrlStatusBar_SetParts($hStatus, $aParts)

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

    _WM_NOTIFY_Register($_g_idLst_Memo)

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

    _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    GUIDelete()
EndFunc   ;==>Example

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 "Extras\HelpFileInternals.au3"
#include "Extras\WM_NOTIFY.au3"

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

Global $g_hMainGUI, $g_hStatus

Example()

Func Example()
    ; Create GUI
    Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 450, 320, 100, 100)

    ; sets parts with no text
    Local $aParts[3] = [75, 150, -1]
    $g_hStatus = _GUICtrlStatusBar_Create($hGUI, $aParts)

    ; Create memo control
    _MemoCreate(2, 8, 444, 259)

    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_idLst_Memo)

    ; 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("")

    _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

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

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 "Extras\HelpFileInternals.au3"
#include "Extras\WM_NOTIFY.au3"

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

Global $g_hMainGUI, $g_hStatus

Example()

Func Example()
    ; Create GUI
    Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 450, 320, 100, 100)

    ;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
    _MemoCreate(2, 8, 444, 259)

    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_idLst_Memo)

    ; 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("")

    _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

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

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 "Extras\HelpFileInternals.au3"
#include "Extras\WM_NOTIFY.au3"

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

Global $g_hMainGUI, $g_hStatus

Example()

Func Example()
    ; Create GUI
    Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 450, 320, 100, 100)

    ; 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
    _MemoCreate(2, 8, 444, 259)

    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_idLst_Memo)

    ; 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

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 "Extras\HelpFileInternals.au3"
#include "Extras\WM_NOTIFY.au3"

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

Global $g_hMainGUI, $g_hStatus

Example()

Func Example()
    ; Create GUI
    Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 450, 320, 100, 100)

    ; 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
    _MemoCreate(2, 8, 444, 259)

    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_idLst_Memo)

    ; 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("")

    _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

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

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 "Extras\HelpFileInternals.au3"
#include "Extras\WM_NOTIFY.au3"

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

Global $g_hMainGUI, $g_hStatus

Example()

Func Example()
    ; Create GUI
    Local $hGUI = GUICreate("StatusBar Create (v" & @AutoItVersion & ")", 450, 320, 100, 100)

    ; 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
    _MemoCreate(2, 8, 444, 259)

    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_idLst_Memo)

    ; 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("")

    _MemoMsgBoxStatus("", -1, $hGUI) ; no more action, wait GUI for closing

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

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 : StatusBar Create to an External process

#include "Extras\HelpFileInternals.au3"

#include <GuiStatusBar.au3>

Example()

Func Example()
    Local $sFromTo
    Local $hWin = _MemoRunAU3OutProcess($sFromTo)

    Local $hStatus = _MemoCreateOutProcess($hWin, "msctls_statusbar32", 0, $sFromTo)

    _GUICtrlStatusBar_Destroy($hStatus)
    If @error Then _MemoWrite("_GUICtrlStatusBar_Destroy()" & " @error = " & @error & @CRLF & _
            @TAB & "cannot be retrieved by an external process")

    _GUICtrlStatusBar_Create($hWin)
    If @error Then _MemoWrite("_GUICtrlStatusBar_Create()" & " @error = " & @error & @CRLF & _
            @TAB & "cannot be retrieved by an external process")

    _MemoMsgBoxStatus("", Default, $hWin) ; no more action, wait GUI for closing, close also OutProcess GUI

EndFunc   ;==>Example