Win32 API 日本語リファレンス
ホームSystem.Ole › OleGetClipboardWithEnterpriseInfo

OleGetClipboardWithEnterpriseInfo

関数
企業情報付きでクリップボードのデータオブジェクトを取得する。
DLLole32.dll呼出規約winapi対応OSWindows 10 以降

シグネチャ

// ole32.dll
#include <windows.h>

HRESULT OleGetClipboardWithEnterpriseInfo(
    IDataObject** dataObject,
    LPWSTR* dataEnterpriseId,
    LPWSTR* sourceDescription,
    LPWSTR* targetDescription,
    LPWSTR* dataDescription
);

パラメーター

名前方向
dataObjectIDataObject**out
dataEnterpriseIdLPWSTR*out
sourceDescriptionLPWSTR*out
targetDescriptionLPWSTR*out
dataDescriptionLPWSTR*out

戻り値の型: HRESULT

各言語での呼び出し定義

// ole32.dll
#include <windows.h>

HRESULT OleGetClipboardWithEnterpriseInfo(
    IDataObject** dataObject,
    LPWSTR* dataEnterpriseId,
    LPWSTR* sourceDescription,
    LPWSTR* targetDescription,
    LPWSTR* dataDescription
);
[DllImport("ole32.dll", ExactSpelling = true)]
static extern int OleGetClipboardWithEnterpriseInfo(
    IntPtr dataObject,   // IDataObject** out
    IntPtr dataEnterpriseId,   // LPWSTR* out
    IntPtr sourceDescription,   // LPWSTR* out
    IntPtr targetDescription,   // LPWSTR* out
    IntPtr dataDescription   // LPWSTR* out
);
<DllImport("ole32.dll", ExactSpelling:=True)>
Public Shared Function OleGetClipboardWithEnterpriseInfo(
    dataObject As IntPtr,   ' IDataObject** out
    dataEnterpriseId As IntPtr,   ' LPWSTR* out
    sourceDescription As IntPtr,   ' LPWSTR* out
    targetDescription As IntPtr,   ' LPWSTR* out
    dataDescription As IntPtr   ' LPWSTR* out
) As Integer
End Function
' dataObject : IDataObject** out
' dataEnterpriseId : LPWSTR* out
' sourceDescription : LPWSTR* out
' targetDescription : LPWSTR* out
' dataDescription : LPWSTR* out
Declare PtrSafe Function OleGetClipboardWithEnterpriseInfo Lib "ole32" ( _
    ByVal dataObject As LongPtr, _
    ByVal dataEnterpriseId As LongPtr, _
    ByVal sourceDescription As LongPtr, _
    ByVal targetDescription As LongPtr, _
    ByVal dataDescription As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

OleGetClipboardWithEnterpriseInfo = ctypes.windll.ole32.OleGetClipboardWithEnterpriseInfo
OleGetClipboardWithEnterpriseInfo.restype = ctypes.c_int
OleGetClipboardWithEnterpriseInfo.argtypes = [
    ctypes.c_void_p,  # dataObject : IDataObject** out
    ctypes.c_void_p,  # dataEnterpriseId : LPWSTR* out
    ctypes.c_void_p,  # sourceDescription : LPWSTR* out
    ctypes.c_void_p,  # targetDescription : LPWSTR* out
    ctypes.c_void_p,  # dataDescription : LPWSTR* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ole32.dll')
OleGetClipboardWithEnterpriseInfo = Fiddle::Function.new(
  lib['OleGetClipboardWithEnterpriseInfo'],
  [
    Fiddle::TYPE_VOIDP,  # dataObject : IDataObject** out
    Fiddle::TYPE_VOIDP,  # dataEnterpriseId : LPWSTR* out
    Fiddle::TYPE_VOIDP,  # sourceDescription : LPWSTR* out
    Fiddle::TYPE_VOIDP,  # targetDescription : LPWSTR* out
    Fiddle::TYPE_VOIDP,  # dataDescription : LPWSTR* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "ole32")]
extern "system" {
    fn OleGetClipboardWithEnterpriseInfo(
        dataObject: *mut *mut core::ffi::c_void,  // IDataObject** out
        dataEnterpriseId: *mut *mut u16,  // LPWSTR* out
        sourceDescription: *mut *mut u16,  // LPWSTR* out
        targetDescription: *mut *mut u16,  // LPWSTR* out
        dataDescription: *mut *mut u16  // LPWSTR* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ole32.dll")]
public static extern int OleGetClipboardWithEnterpriseInfo(IntPtr dataObject, IntPtr dataEnterpriseId, IntPtr sourceDescription, IntPtr targetDescription, IntPtr dataDescription);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ole32_OleGetClipboardWithEnterpriseInfo' -Namespace Win32 -PassThru
# $api::OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
#uselib "ole32.dll"
#func global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" sptr, sptr, sptr, sptr, sptr
; OleGetClipboardWithEnterpriseInfo dataObject, varptr(dataEnterpriseId), varptr(sourceDescription), varptr(targetDescription), varptr(dataDescription)   ; 戻り値は stat
; dataObject : IDataObject** out -> "sptr"
; dataEnterpriseId : LPWSTR* out -> "sptr"
; sourceDescription : LPWSTR* out -> "sptr"
; targetDescription : LPWSTR* out -> "sptr"
; dataDescription : LPWSTR* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "ole32.dll"
#cfunc global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" sptr, var, var, var, var
; res = OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
; dataObject : IDataObject** out -> "sptr"
; dataEnterpriseId : LPWSTR* out -> "var"
; sourceDescription : LPWSTR* out -> "var"
; targetDescription : LPWSTR* out -> "var"
; dataDescription : LPWSTR* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT OleGetClipboardWithEnterpriseInfo(IDataObject** dataObject, LPWSTR* dataEnterpriseId, LPWSTR* sourceDescription, LPWSTR* targetDescription, LPWSTR* dataDescription)
#uselib "ole32.dll"
#cfunc global OleGetClipboardWithEnterpriseInfo "OleGetClipboardWithEnterpriseInfo" intptr, var, var, var, var
; res = OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
; dataObject : IDataObject** out -> "intptr"
; dataEnterpriseId : LPWSTR* out -> "var"
; sourceDescription : LPWSTR* out -> "var"
; targetDescription : LPWSTR* out -> "var"
; dataDescription : LPWSTR* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	ole32 = windows.NewLazySystemDLL("ole32.dll")
	procOleGetClipboardWithEnterpriseInfo = ole32.NewProc("OleGetClipboardWithEnterpriseInfo")
)

// dataObject (IDataObject** out), dataEnterpriseId (LPWSTR* out), sourceDescription (LPWSTR* out), targetDescription (LPWSTR* out), dataDescription (LPWSTR* out)
r1, _, err := procOleGetClipboardWithEnterpriseInfo.Call(
	uintptr(dataObject),
	uintptr(dataEnterpriseId),
	uintptr(sourceDescription),
	uintptr(targetDescription),
	uintptr(dataDescription),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function OleGetClipboardWithEnterpriseInfo(
  dataObject: Pointer;   // IDataObject** out
  dataEnterpriseId: PPWideChar;   // LPWSTR* out
  sourceDescription: PPWideChar;   // LPWSTR* out
  targetDescription: PPWideChar;   // LPWSTR* out
  dataDescription: PPWideChar   // LPWSTR* out
): Integer; stdcall;
  external 'ole32.dll' name 'OleGetClipboardWithEnterpriseInfo';
result := DllCall("ole32\OleGetClipboardWithEnterpriseInfo"
    , "Ptr", dataObject   ; IDataObject** out
    , "Ptr", dataEnterpriseId   ; LPWSTR* out
    , "Ptr", sourceDescription   ; LPWSTR* out
    , "Ptr", targetDescription   ; LPWSTR* out
    , "Ptr", dataDescription   ; LPWSTR* out
    , "Int")   ; return: HRESULT
●OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription) = DLL("ole32.dll", "int OleGetClipboardWithEnterpriseInfo(void*, void*, void*, void*, void*)")
# 呼び出し: OleGetClipboardWithEnterpriseInfo(dataObject, dataEnterpriseId, sourceDescription, targetDescription, dataDescription)
# dataObject : IDataObject** out -> "void*"
# dataEnterpriseId : LPWSTR* out -> "void*"
# sourceDescription : LPWSTR* out -> "void*"
# targetDescription : LPWSTR* out -> "void*"
# dataDescription : LPWSTR* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。