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

DeleteColorSpace

関数
色空間オブジェクトを削除する。
DLLGDI32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL DeleteColorSpace(
    HCOLORSPACE hcs
);

パラメーター

名前方向
hcsHCOLORSPACEin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

DeleteColorSpace = ctypes.windll.gdi32.DeleteColorSpace
DeleteColorSpace.restype = wintypes.BOOL
DeleteColorSpace.argtypes = [
    wintypes.HANDLE,  # hcs : HCOLORSPACE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdi32 = windows.NewLazySystemDLL("GDI32.dll")
	procDeleteColorSpace = gdi32.NewProc("DeleteColorSpace")
)

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