# Function Reference

# GUICtrlSendMsg

Send a message to a control.

GUICtrlSendMsg ( controlID, msg , wParam, lParam )

## Parameters

controlID | The control identifier (controlID) as returned by a GUICtrlCreate...() function, or -1 for the last created control.
msg | type of message to be send to the control as defined in the Windows control documentation.
wParam | The first param to send to the control.
lParam | The second param to send to the control.

## Return Value

Success: | the value returned by the SendMessage Windows API.
Failure: | 0.

## Remarks

This function allows the sending of special Windows messages directly to the control using the SendMessage API. It is used to enable special control features not available with the simple GUICtrlRead() and GUICtrlUpdate.... range of functions.
The parameters (wParam and lParam) can be an integer or a string.
GUICtrlSendMsg() should be used for messages that have no special return types. For more advanced messages where you must be able to receive extra data you must use GUICtrlRecvMsg().

## Related

GUICtrlCreate..., GUICtrlRead, GUICtrlRecvMsg, GUICtrlUpdate..., GUIGetMsg

## Example

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

    Example()

    Func Example()
        GUICreate("Marquee Progress Bar", 290, 90, -1, -1) ; An example of starting/stopping a scrolling marquee of a progress bar.
        Local $idProgress = GUICtrlCreateProgress(10, 10, 270, 20, $PBS_MARQUEE)
        Local $idBtn_Start = GUICtrlCreateButton("&Start", 10, 60, 70, 25)
        Local $idBtn_Stop = GUICtrlCreateButton("S&top", 85, 60, 70, 25)

        GUISetState(@SW_SHOW)

        ; Loop until the user exits.
        While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    ExitLoop

                Case $idBtn_Start
                    GUICtrlSendMsg($idProgress, $PBM_SETMARQUEE, 1, 50) ; Send the message $PBM_SETMARQUEE and wParam of 1 to start the scrolling marquee.

                Case $idBtn_Stop
                    GUICtrlSendMsg($idProgress, $PBM_SETMARQUEE, 0, 50) ; Send the message $PBM_SETMARQUEE and wParam of 0 to stop the scrolling marquee.

            EndSwitch
        WEnd
    EndFunc   ;==>Example