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

ImageList_Read

関数
ストリームからイメージリストを読み込む。
DLLCOMCTL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HIMAGELIST ImageList_Read(
    IStream* pstm
);

パラメーター

名前方向
pstmIStream*in

戻り値の型: HIMAGELIST

各言語での呼び出し定義

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

HIMAGELIST ImageList_Read(
    IStream* pstm
);
[DllImport("COMCTL32.dll", ExactSpelling = true)]
static extern IntPtr ImageList_Read(
    IntPtr pstm   // IStream*
);
<DllImport("COMCTL32.dll", ExactSpelling:=True)>
Public Shared Function ImageList_Read(
    pstm As IntPtr   ' IStream*
) As IntPtr
End Function
' pstm : IStream*
Declare PtrSafe Function ImageList_Read Lib "comctl32" ( _
    ByVal pstm As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ImageList_Read = ctypes.windll.comctl32.ImageList_Read
ImageList_Read.restype = ctypes.c_ssize_t
ImageList_Read.argtypes = [
    ctypes.c_void_p,  # pstm : IStream*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procImageList_Read = comctl32.NewProc("ImageList_Read")
)

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