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

ImageList_DrawIndirect

関数
構造体パラメータで指定してイメージリスト画像を描画する。
DLLCOMCTL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

BOOL ImageList_DrawIndirect(
    IMAGELISTDRAWPARAMS* pimldp
);

パラメーター

名前方向
pimldpIMAGELISTDRAWPARAMS*in

戻り値の型: BOOL

各言語での呼び出し定義

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

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

ImageList_DrawIndirect = ctypes.windll.comctl32.ImageList_DrawIndirect
ImageList_DrawIndirect.restype = wintypes.BOOL
ImageList_DrawIndirect.argtypes = [
    ctypes.c_void_p,  # pimldp : IMAGELISTDRAWPARAMS*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procImageList_DrawIndirect = comctl32.NewProc("ImageList_DrawIndirect")
)

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