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

CloseColorProfile

関数
開いているカラープロファイルを閉じる。
DLLmscms.dll呼出規約winapi

シグネチャ

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

BOOL CloseColorProfile(
    INT_PTR hProfile   // optional
);

パラメーター

名前方向
hProfileINT_PTRinoptional

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL CloseColorProfile(
    INT_PTR hProfile   // optional
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll", ExactSpelling = true)]
static extern bool CloseColorProfile(
    IntPtr hProfile   // INT_PTR optional
);
<DllImport("mscms.dll", ExactSpelling:=True)>
Public Shared Function CloseColorProfile(
    hProfile As IntPtr   ' INT_PTR optional
) As Boolean
End Function
' hProfile : INT_PTR optional
Declare PtrSafe Function CloseColorProfile Lib "mscms" ( _
    ByVal hProfile As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CloseColorProfile = ctypes.windll.mscms.CloseColorProfile
CloseColorProfile.restype = wintypes.BOOL
CloseColorProfile.argtypes = [
    ctypes.c_ssize_t,  # hProfile : INT_PTR optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	mscms = windows.NewLazySystemDLL("mscms.dll")
	procCloseColorProfile = mscms.NewProc("CloseColorProfile")
)

// hProfile (INT_PTR optional)
r1, _, err := procCloseColorProfile.Call(
	uintptr(hProfile),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function CloseColorProfile(
  hProfile: NativeInt   // INT_PTR optional
): BOOL; stdcall;
  external 'mscms.dll' name 'CloseColorProfile';
result := DllCall("mscms\CloseColorProfile"
    , "Ptr", hProfile   ; INT_PTR optional
    , "Int")   ; return: BOOL
●CloseColorProfile(hProfile) = DLL("mscms.dll", "bool CloseColorProfile(int)")
# 呼び出し: CloseColorProfile(hProfile)
# hProfile : INT_PTR optional -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。