g
    
    ' Ensure the return array is clear:
    Erase bData
    
    hMem = GetClipboardMemoryHandle(lFormatId)
    ' If success:
    If (hMem &lt;&gt; 0) Then
        ' Get the size of this memory block:
        lSize = GlobalSize(hMem)
        ' Get a pointer to the memory:
        lPtr = GlobalLock(hMem)
        If (lSize &gt; 0) Then
            ' Resize the byte array to hold the data:
            ReDim bData(0 To lSize - 1) As Byte
            ' Copy from the pointer into the array:
            Cop