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

Shell_GetImageLists

関数
システムの大小アイコンイメージリストを取得する。
DLLSHELL32.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

BOOL Shell_GetImageLists(
    HIMAGELIST* phiml,   // optional
    HIMAGELIST* phimlSmall   // optional
);

パラメーター

名前方向
phimlHIMAGELIST*outoptional
phimlSmallHIMAGELIST*outoptional

戻り値の型: BOOL

各言語での呼び出し定義

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

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

Shell_GetImageLists = ctypes.windll.shell32.Shell_GetImageLists
Shell_GetImageLists.restype = wintypes.BOOL
Shell_GetImageLists.argtypes = [
    ctypes.c_void_p,  # phiml : HIMAGELIST* optional, out
    ctypes.c_void_p,  # phimlSmall : HIMAGELIST* optional, out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	shell32 = windows.NewLazySystemDLL("SHELL32.dll")
	procShell_GetImageLists = shell32.NewProc("Shell_GetImageLists")
)

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