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

CMGetInfo

関数
カラーマネジメントモジュールの情報を取得する。
DLLICM32.dll呼出規約winapi

シグネチャ

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

DWORD CMGetInfo(
    DWORD dwInfo
);

パラメーター

名前方向
dwInfoDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD CMGetInfo(
    DWORD dwInfo
);
[DllImport("ICM32.dll", ExactSpelling = true)]
static extern uint CMGetInfo(
    uint dwInfo   // DWORD
);
<DllImport("ICM32.dll", ExactSpelling:=True)>
Public Shared Function CMGetInfo(
    dwInfo As UInteger   ' DWORD
) As UInteger
End Function
' dwInfo : DWORD
Declare PtrSafe Function CMGetInfo Lib "icm32" ( _
    ByVal dwInfo As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CMGetInfo = ctypes.windll.icm32.CMGetInfo
CMGetInfo.restype = wintypes.DWORD
CMGetInfo.argtypes = [
    wintypes.DWORD,  # dwInfo : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ICM32.dll')
CMGetInfo = Fiddle::Function.new(
  lib['CMGetInfo'],
  [
    -Fiddle::TYPE_INT,  # dwInfo : DWORD
  ],
  -Fiddle::TYPE_INT)
#[link(name = "icm32")]
extern "system" {
    fn CMGetInfo(
        dwInfo: u32  // DWORD
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ICM32.dll")]
public static extern uint CMGetInfo(uint dwInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ICM32_CMGetInfo' -Namespace Win32 -PassThru
# $api::CMGetInfo(dwInfo)
#uselib "ICM32.dll"
#func global CMGetInfo "CMGetInfo" sptr
; CMGetInfo dwInfo   ; 戻り値は stat
; dwInfo : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "ICM32.dll"
#cfunc global CMGetInfo "CMGetInfo" int
; res = CMGetInfo(dwInfo)
; dwInfo : DWORD -> "int"
; DWORD CMGetInfo(DWORD dwInfo)
#uselib "ICM32.dll"
#cfunc global CMGetInfo "CMGetInfo" int
; res = CMGetInfo(dwInfo)
; dwInfo : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	icm32 = windows.NewLazySystemDLL("ICM32.dll")
	procCMGetInfo = icm32.NewProc("CMGetInfo")
)

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