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

InitCommonControlsEx

関数
指定クラスのコモンコントロールを登録し初期化する。
DLLCOMCTL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

BOOL InitCommonControlsEx(
    const INITCOMMONCONTROLSEX* picce
);

パラメーター

名前方向
picceINITCOMMONCONTROLSEX*in

戻り値の型: BOOL

各言語での呼び出し定義

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

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

InitCommonControlsEx = ctypes.windll.comctl32.InitCommonControlsEx
InitCommonControlsEx.restype = wintypes.BOOL
InitCommonControlsEx.argtypes = [
    ctypes.c_void_p,  # picce : INITCOMMONCONTROLSEX*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('COMCTL32.dll')
InitCommonControlsEx = Fiddle::Function.new(
  lib['InitCommonControlsEx'],
  [
    Fiddle::TYPE_VOIDP,  # picce : INITCOMMONCONTROLSEX*
  ],
  Fiddle::TYPE_INT)
#[link(name = "comctl32")]
extern "system" {
    fn InitCommonControlsEx(
        picce: *const INITCOMMONCONTROLSEX  // INITCOMMONCONTROLSEX*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("COMCTL32.dll")]
public static extern bool InitCommonControlsEx(IntPtr picce);
"@
$api = Add-Type -MemberDefinition $sig -Name 'COMCTL32_InitCommonControlsEx' -Namespace Win32 -PassThru
# $api::InitCommonControlsEx(picce)
#uselib "COMCTL32.dll"
#func global InitCommonControlsEx "InitCommonControlsEx" sptr
; InitCommonControlsEx varptr(picce)   ; 戻り値は stat
; picce : INITCOMMONCONTROLSEX* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "COMCTL32.dll"
#cfunc global InitCommonControlsEx "InitCommonControlsEx" var
; res = InitCommonControlsEx(picce)
; picce : INITCOMMONCONTROLSEX* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL InitCommonControlsEx(INITCOMMONCONTROLSEX* picce)
#uselib "COMCTL32.dll"
#cfunc global InitCommonControlsEx "InitCommonControlsEx" var
; res = InitCommonControlsEx(picce)
; picce : INITCOMMONCONTROLSEX* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procInitCommonControlsEx = comctl32.NewProc("InitCommonControlsEx")
)

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