Win32 API 日本語リファレンス
ホームUI.ColorSystem › WcsDisassociateColorProfileFromDevice

WcsDisassociateColorProfileFromDevice

関数
WCSでプロファイルとデバイスの関連付けを解除する。
DLLmscms.dll呼出規約winapi

シグネチャ

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

BOOL WcsDisassociateColorProfileFromDevice(
    WCS_PROFILE_MANAGEMENT_SCOPE scope,
    LPCWSTR pProfileName,
    LPCWSTR pDeviceName
);

パラメーター

名前方向
scopeWCS_PROFILE_MANAGEMENT_SCOPEin
pProfileNameLPCWSTRin
pDeviceNameLPCWSTRin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL WcsDisassociateColorProfileFromDevice(
    WCS_PROFILE_MANAGEMENT_SCOPE scope,
    LPCWSTR pProfileName,
    LPCWSTR pDeviceName
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll", ExactSpelling = true)]
static extern bool WcsDisassociateColorProfileFromDevice(
    int scope,   // WCS_PROFILE_MANAGEMENT_SCOPE
    [MarshalAs(UnmanagedType.LPWStr)] string pProfileName,   // LPCWSTR
    [MarshalAs(UnmanagedType.LPWStr)] string pDeviceName   // LPCWSTR
);
<DllImport("mscms.dll", ExactSpelling:=True)>
Public Shared Function WcsDisassociateColorProfileFromDevice(
    scope As Integer,   ' WCS_PROFILE_MANAGEMENT_SCOPE
    <MarshalAs(UnmanagedType.LPWStr)> pProfileName As String,   ' LPCWSTR
    <MarshalAs(UnmanagedType.LPWStr)> pDeviceName As String   ' LPCWSTR
) As Boolean
End Function
' scope : WCS_PROFILE_MANAGEMENT_SCOPE
' pProfileName : LPCWSTR
' pDeviceName : LPCWSTR
Declare PtrSafe Function WcsDisassociateColorProfileFromDevice Lib "mscms" ( _
    ByVal scope As Long, _
    ByVal pProfileName As LongPtr, _
    ByVal pDeviceName As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WcsDisassociateColorProfileFromDevice = ctypes.windll.mscms.WcsDisassociateColorProfileFromDevice
WcsDisassociateColorProfileFromDevice.restype = wintypes.BOOL
WcsDisassociateColorProfileFromDevice.argtypes = [
    ctypes.c_int,  # scope : WCS_PROFILE_MANAGEMENT_SCOPE
    wintypes.LPCWSTR,  # pProfileName : LPCWSTR
    wintypes.LPCWSTR,  # pDeviceName : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('mscms.dll')
WcsDisassociateColorProfileFromDevice = Fiddle::Function.new(
  lib['WcsDisassociateColorProfileFromDevice'],
  [
    Fiddle::TYPE_INT,  # scope : WCS_PROFILE_MANAGEMENT_SCOPE
    Fiddle::TYPE_VOIDP,  # pProfileName : LPCWSTR
    Fiddle::TYPE_VOIDP,  # pDeviceName : LPCWSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "mscms")]
extern "system" {
    fn WcsDisassociateColorProfileFromDevice(
        scope: i32,  // WCS_PROFILE_MANAGEMENT_SCOPE
        pProfileName: *const u16,  // LPCWSTR
        pDeviceName: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll")]
public static extern bool WcsDisassociateColorProfileFromDevice(int scope, [MarshalAs(UnmanagedType.LPWStr)] string pProfileName, [MarshalAs(UnmanagedType.LPWStr)] string pDeviceName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'mscms_WcsDisassociateColorProfileFromDevice' -Namespace Win32 -PassThru
# $api::WcsDisassociateColorProfileFromDevice(scope, pProfileName, pDeviceName)
#uselib "mscms.dll"
#func global WcsDisassociateColorProfileFromDevice "WcsDisassociateColorProfileFromDevice" sptr, sptr, sptr
; WcsDisassociateColorProfileFromDevice scope, pProfileName, pDeviceName   ; 戻り値は stat
; scope : WCS_PROFILE_MANAGEMENT_SCOPE -> "sptr"
; pProfileName : LPCWSTR -> "sptr"
; pDeviceName : LPCWSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "mscms.dll"
#cfunc global WcsDisassociateColorProfileFromDevice "WcsDisassociateColorProfileFromDevice" int, wstr, wstr
; res = WcsDisassociateColorProfileFromDevice(scope, pProfileName, pDeviceName)
; scope : WCS_PROFILE_MANAGEMENT_SCOPE -> "int"
; pProfileName : LPCWSTR -> "wstr"
; pDeviceName : LPCWSTR -> "wstr"
; BOOL WcsDisassociateColorProfileFromDevice(WCS_PROFILE_MANAGEMENT_SCOPE scope, LPCWSTR pProfileName, LPCWSTR pDeviceName)
#uselib "mscms.dll"
#cfunc global WcsDisassociateColorProfileFromDevice "WcsDisassociateColorProfileFromDevice" int, wstr, wstr
; res = WcsDisassociateColorProfileFromDevice(scope, pProfileName, pDeviceName)
; scope : WCS_PROFILE_MANAGEMENT_SCOPE -> "int"
; pProfileName : LPCWSTR -> "wstr"
; pDeviceName : LPCWSTR -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mscms = windows.NewLazySystemDLL("mscms.dll")
	procWcsDisassociateColorProfileFromDevice = mscms.NewProc("WcsDisassociateColorProfileFromDevice")
)

// scope (WCS_PROFILE_MANAGEMENT_SCOPE), pProfileName (LPCWSTR), pDeviceName (LPCWSTR)
r1, _, err := procWcsDisassociateColorProfileFromDevice.Call(
	uintptr(scope),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pProfileName))),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pDeviceName))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function WcsDisassociateColorProfileFromDevice(
  scope: Integer;   // WCS_PROFILE_MANAGEMENT_SCOPE
  pProfileName: PWideChar;   // LPCWSTR
  pDeviceName: PWideChar   // LPCWSTR
): BOOL; stdcall;
  external 'mscms.dll' name 'WcsDisassociateColorProfileFromDevice';
result := DllCall("mscms\WcsDisassociateColorProfileFromDevice"
    , "Int", scope   ; WCS_PROFILE_MANAGEMENT_SCOPE
    , "WStr", pProfileName   ; LPCWSTR
    , "WStr", pDeviceName   ; LPCWSTR
    , "Int")   ; return: BOOL
●WcsDisassociateColorProfileFromDevice(scope, pProfileName, pDeviceName) = DLL("mscms.dll", "bool WcsDisassociateColorProfileFromDevice(int, char*, char*)")
# 呼び出し: WcsDisassociateColorProfileFromDevice(scope, pProfileName, pDeviceName)
# scope : WCS_PROFILE_MANAGEMENT_SCOPE -> "int"
# pProfileName : LPCWSTR -> "char*"
# pDeviceName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。