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

ImageList_Write

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

シグネチャ

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

BOOL ImageList_Write(
    HIMAGELIST himl,
    IStream* pstm
);

パラメーター

名前方向
himlHIMAGELISTin
pstmIStream*in

戻り値の型: BOOL

各言語での呼び出し定義

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

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

ImageList_Write = ctypes.windll.comctl32.ImageList_Write
ImageList_Write.restype = wintypes.BOOL
ImageList_Write.argtypes = [
    ctypes.c_ssize_t,  # himl : HIMAGELIST
    ctypes.c_void_p,  # pstm : IStream*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	comctl32 = windows.NewLazySystemDLL("COMCTL32.dll")
	procImageList_Write = comctl32.NewProc("ImageList_Write")
)

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