基本上应该是这样: Private Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long Private Declare Function GlobalUnlock Lib "kernel32" (ByVal hMem As Long) As Long Private Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function CloseClipboard Lib "user32" () As Long Private Declare Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As Long Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long) Private Declare Function GlobalSize Lib "kernel32" (ByVal hMem As Long) As Long Private Declare Function EmptyClipboard Lib "user32" () As Long dim sdata() as Byte OpenClipboard 0& hMem = GetClipboardData([#剪贴板格式编号]) '编号不同, 取出的数据也不同 If CBool(hMem) Then nClipsize = GlobalSize(hMem) lpData = GlobalLock(hMem) If lpData <> 0 Then ReDim sdata(0 To nClipsize) As Byte CopyMemory sdata(0), ByVal lpData, nClipsize End If End If GlobalUnlock hMem EmptyClipboard CloseClipboard
[此贴子已经被作者于2008-3-10 14:19:56编辑过] |