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

GetThemeIntList

関数
指定プロパティのテーマ整数リストを取得する。
DLLUxTheme.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT GetThemeIntList(
    HTHEME hTheme,
    INT iPartId,
    INT iStateId,
    INT iPropId,
    INTLIST* pIntList
);

パラメーター

名前方向
hThemeHTHEMEin
iPartIdINTin
iStateIdINTin
iPropIdINTin
pIntListINTLIST*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT GetThemeIntList(
    HTHEME hTheme,
    INT iPartId,
    INT iStateId,
    INT iPropId,
    INTLIST* pIntList
);
[DllImport("UxTheme.dll", ExactSpelling = true)]
static extern int GetThemeIntList(
    IntPtr hTheme,   // HTHEME
    int iPartId,   // INT
    int iStateId,   // INT
    int iPropId,   // INT
    IntPtr pIntList   // INTLIST* out
);
<DllImport("UxTheme.dll", ExactSpelling:=True)>
Public Shared Function GetThemeIntList(
    hTheme As IntPtr,   ' HTHEME
    iPartId As Integer,   ' INT
    iStateId As Integer,   ' INT
    iPropId As Integer,   ' INT
    pIntList As IntPtr   ' INTLIST* out
) As Integer
End Function
' hTheme : HTHEME
' iPartId : INT
' iStateId : INT
' iPropId : INT
' pIntList : INTLIST* out
Declare PtrSafe Function GetThemeIntList Lib "uxtheme" ( _
    ByVal hTheme As LongPtr, _
    ByVal iPartId As Long, _
    ByVal iStateId As Long, _
    ByVal iPropId As Long, _
    ByVal pIntList As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetThemeIntList = ctypes.windll.uxtheme.GetThemeIntList
GetThemeIntList.restype = ctypes.c_int
GetThemeIntList.argtypes = [
    ctypes.c_ssize_t,  # hTheme : HTHEME
    ctypes.c_int,  # iPartId : INT
    ctypes.c_int,  # iStateId : INT
    ctypes.c_int,  # iPropId : INT
    ctypes.c_void_p,  # pIntList : INTLIST* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('UxTheme.dll')
GetThemeIntList = Fiddle::Function.new(
  lib['GetThemeIntList'],
  [
    Fiddle::TYPE_INTPTR_T,  # hTheme : HTHEME
    Fiddle::TYPE_INT,  # iPartId : INT
    Fiddle::TYPE_INT,  # iStateId : INT
    Fiddle::TYPE_INT,  # iPropId : INT
    Fiddle::TYPE_VOIDP,  # pIntList : INTLIST* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "uxtheme")]
extern "system" {
    fn GetThemeIntList(
        hTheme: isize,  // HTHEME
        iPartId: i32,  // INT
        iStateId: i32,  // INT
        iPropId: i32,  // INT
        pIntList: *mut INTLIST  // INTLIST* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("UxTheme.dll")]
public static extern int GetThemeIntList(IntPtr hTheme, int iPartId, int iStateId, int iPropId, IntPtr pIntList);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UxTheme_GetThemeIntList' -Namespace Win32 -PassThru
# $api::GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList)
#uselib "UxTheme.dll"
#func global GetThemeIntList "GetThemeIntList" sptr, sptr, sptr, sptr, sptr
; GetThemeIntList hTheme, iPartId, iStateId, iPropId, varptr(pIntList)   ; 戻り値は stat
; hTheme : HTHEME -> "sptr"
; iPartId : INT -> "sptr"
; iStateId : INT -> "sptr"
; iPropId : INT -> "sptr"
; pIntList : INTLIST* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "UxTheme.dll"
#cfunc global GetThemeIntList "GetThemeIntList" sptr, int, int, int, var
; res = GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList)
; hTheme : HTHEME -> "sptr"
; iPartId : INT -> "int"
; iStateId : INT -> "int"
; iPropId : INT -> "int"
; pIntList : INTLIST* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT GetThemeIntList(HTHEME hTheme, INT iPartId, INT iStateId, INT iPropId, INTLIST* pIntList)
#uselib "UxTheme.dll"
#cfunc global GetThemeIntList "GetThemeIntList" intptr, int, int, int, var
; res = GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList)
; hTheme : HTHEME -> "intptr"
; iPartId : INT -> "int"
; iStateId : INT -> "int"
; iPropId : INT -> "int"
; pIntList : INTLIST* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	uxtheme = windows.NewLazySystemDLL("UxTheme.dll")
	procGetThemeIntList = uxtheme.NewProc("GetThemeIntList")
)

// hTheme (HTHEME), iPartId (INT), iStateId (INT), iPropId (INT), pIntList (INTLIST* out)
r1, _, err := procGetThemeIntList.Call(
	uintptr(hTheme),
	uintptr(iPartId),
	uintptr(iStateId),
	uintptr(iPropId),
	uintptr(pIntList),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function GetThemeIntList(
  hTheme: NativeInt;   // HTHEME
  iPartId: Integer;   // INT
  iStateId: Integer;   // INT
  iPropId: Integer;   // INT
  pIntList: Pointer   // INTLIST* out
): Integer; stdcall;
  external 'UxTheme.dll' name 'GetThemeIntList';
result := DllCall("UxTheme\GetThemeIntList"
    , "Ptr", hTheme   ; HTHEME
    , "Int", iPartId   ; INT
    , "Int", iStateId   ; INT
    , "Int", iPropId   ; INT
    , "Ptr", pIntList   ; INTLIST* out
    , "Int")   ; return: HRESULT
●GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList) = DLL("UxTheme.dll", "int GetThemeIntList(int, int, int, int, void*)")
# 呼び出し: GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList)
# hTheme : HTHEME -> "int"
# iPartId : INT -> "int"
# iStateId : INT -> "int"
# iPropId : INT -> "int"
# pIntList : INTLIST* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。