# Function Reference

# _ClipBoard_GetSequenceNumber

Retrieves the clipboard sequence number for the current window station

#include <Clipboard.au3>
_ClipBoard_GetSequenceNumber ( )

## Return Value

Success: | The clipboard sequence number
Failure: | 0

## Remarks

The system keeps a serial number for the clipboard for each window station. This number is incremented when the contents of the clipboard change or the clipboard is emptied. You can track this value to determine if the clipboard contents have changed and optimize creating data objects. If clipboard rendering is delayed, the sequence number is not incremented until the changes are rendered.

## See Also

Search GetClipboardSequenceNumber in MSDN Library.

## Example

    #include "Extras\HelpFileInternals.au3"

    #include <Clipboard.au3>
    #include <GUIConstantsEx.au3>
    #include <WinAPIError.au3>
    #include <WindowsStylesConstants.au3>

    Example()

    Func Example()
        Local $hGUI

        ; Create GUI
        $hGUI = GUICreate("Clipboard", 600, 400)
        _MemoCreate(2, 2, 596, 396, $WS_VSCROLL)
        GUISetState(@SW_SHOW)

        ; Open the clipboard
        If _ClipBoard_Open($hGUI) Then

            ShowData($hGUI)

            ; Close the clipboard
            _ClipBoard_Close()
        Else
            _WinAPI_ShowError("_ClipBoard_Open failed")
        EndIf

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

    ; Show clipboard statistics
    Func ShowData($hGUI)
        _MemoWrite("GUI handle ............: " & $hGUI)
        _MemoWrite("Clipboard owner .......: " & _ClipBoard_GetOwner())
        _MemoWrite("Clipboard open window .: " & _ClipBoard_GetOpenWindow())
        _MemoWrite("Clipboard sequence ....: " & _ClipBoard_GetSequenceNumber())
        _MemoWrite()
    EndFunc   ;==>ShowData