お世話になります。
クリップボードからDIB情報を取得する場合は以下の手順で
処理を行って下さい。
Declare Function GlobalLock Lib “KERNEL32.DLL” (ByVal hg As Long) As Long
Declare Function GlobalUnlock Lib “KERNEL32.DLL” (byvalptr As Long) As Long
Declare Function OpenClipboard Lib “USER32.DLL” (ByVal hwnd As Long) As Long
Declare Function CloseClipboard Lib “USER32.DLL” () As Long
Declare Function GetClipboardData Lib “USER32.DLL” (ByVal fmt As Long) As Long
※また、wrSetDIBのDeclare定義の引数が「lpbminfo as any」
となっている場合は「ByVal lpbminfo as any」として下さい。
Dim hDIB As Long
Dim DIBPtr As Long
If Clipboard.GetFormat(vbCFDIB) Then
If CBool(OpenClipboard(frm.hwnd)) Then
hDIB = GetClipboardData(vbCFDIB)
If hDIB <> 0 Then
DIBPtr = GlobalLock(hDIB)
If DIBPtr <> 0 Then
If wrSetDIB(hReport, “imgFace”, DIBPtr) = False Then
MsgBox “ERROR=” & wrGetErrorCode(hReport, 0)
End If
GlobalUnlock hDIB
End If
End If
CloseClipboard
End If
End If
以上です。宜しくお願い致します。