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ウィンドウの指定されたテーマデータへのハンドルです。HTHEME を作成するには OpenThemeData を使用します。
iPartIdINTin返すデータのリストを含むパーツを指定する int 型の値です。Parts and States を参照してください。
iStateIdINTinパーツの状態を指定する int 型の値です。Parts and States を参照してください。
iPropIdINTin取得するプロパティを指定する int 型の値です。Property Identifiers を参照してください。
pIntListINTLIST*outint データを受け取る INTLIST 構造体へのポインターです。

戻り値の型: HRESULT

公式ドキュメント

ビジュアルスタイルから int データのリストを取得します。

戻り値

型: HRESULT

成功した場合は S_OK を返し、それ以外の場合はエラーコードを返します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での呼び出し定義

// 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)。
const std = @import("std");

extern "uxtheme" fn GetThemeIntList(
    hTheme: isize, // HTHEME
    iPartId: i32, // INT
    iStateId: i32, // INT
    iPropId: i32, // INT
    pIntList: [*c]INTLIST // INTLIST* out
) callconv(std.os.windows.WINAPI) i32;
proc GetThemeIntList(
    hTheme: int,  # HTHEME
    iPartId: int32,  # INT
    iStateId: int32,  # INT
    iPropId: int32,  # INT
    pIntList: ptr INTLIST  # INTLIST* out
): int32 {.importc: "GetThemeIntList", stdcall, dynlib: "UXTHEME.dll".}
pragma(lib, "uxtheme");
extern(Windows)
int GetThemeIntList(
    ptrdiff_t hTheme,   // HTHEME
    int iPartId,   // INT
    int iStateId,   // INT
    int iPropId,   // INT
    INTLIST* pIntList   // INTLIST* out
);
ccall((:GetThemeIntList, "UXTHEME.dll"), stdcall, Int32,
      (Int, Int32, Int32, Int32, Ptr{INTLIST}),
      hTheme, iPartId, iStateId, iPropId, pIntList)
# hTheme : HTHEME -> Int
# iPartId : INT -> Int32
# iStateId : INT -> Int32
# iPropId : INT -> Int32
# pIntList : INTLIST* out -> Ptr{INTLIST}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t GetThemeIntList(
    intptr_t hTheme,
    int32_t iPartId,
    int32_t iStateId,
    int32_t iPropId,
    void* pIntList);
]]
local uxtheme = ffi.load("uxtheme")
-- uxtheme.GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList)
-- hTheme : HTHEME
-- iPartId : INT
-- iStateId : INT
-- iPropId : INT
-- pIntList : INTLIST* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('UXTHEME.dll');
const GetThemeIntList = lib.func('__stdcall', 'GetThemeIntList', 'int32_t', ['intptr_t', 'int32_t', 'int32_t', 'int32_t', 'void *']);
// GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList)
// hTheme : HTHEME -> 'intptr_t'
// iPartId : INT -> 'int32_t'
// iStateId : INT -> 'int32_t'
// iPropId : INT -> 'int32_t'
// pIntList : INTLIST* out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("UXTHEME.dll", {
  GetThemeIntList: { parameters: ["isize", "i32", "i32", "i32", "pointer"], result: "i32" },
});
// lib.symbols.GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList)
// hTheme : HTHEME -> "isize"
// iPartId : INT -> "i32"
// iStateId : INT -> "i32"
// iPropId : INT -> "i32"
// pIntList : INTLIST* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t GetThemeIntList(
    intptr_t hTheme,
    int32_t iPartId,
    int32_t iStateId,
    int32_t iPropId,
    void* pIntList);
C, "UXTHEME.dll");
// $ffi->GetThemeIntList(hTheme, iPartId, iStateId, iPropId, pIntList);
// hTheme : HTHEME
// iPartId : INT
// iStateId : INT
// iPropId : INT
// pIntList : INTLIST* out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Uxtheme extends StdCallLibrary {
    Uxtheme INSTANCE = Native.load("uxtheme", Uxtheme.class);
    int GetThemeIntList(
        long hTheme,   // HTHEME
        int iPartId,   // INT
        int iStateId,   // INT
        int iPropId,   // INT
        Pointer pIntList   // INTLIST* out
    );
}
@[Link("uxtheme")]
lib LibUXTHEME
  fun GetThemeIntList = GetThemeIntList(
    hTheme : LibC::SSizeT,   # HTHEME
    iPartId : Int32,   # INT
    iStateId : Int32,   # INT
    iPropId : Int32,   # INT
    pIntList : INTLIST*   # INTLIST* out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef GetThemeIntListNative = Int32 Function(IntPtr, Int32, Int32, Int32, Pointer<Void>);
typedef GetThemeIntListDart = int Function(int, int, int, int, Pointer<Void>);
final GetThemeIntList = DynamicLibrary.open('UXTHEME.dll')
    .lookupFunction<GetThemeIntListNative, GetThemeIntListDart>('GetThemeIntList');
// hTheme : HTHEME -> IntPtr
// iPartId : INT -> Int32
// iStateId : INT -> Int32
// iPropId : INT -> Int32
// pIntList : INTLIST* out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
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';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "GetThemeIntList"
  c_GetThemeIntList :: CIntPtr -> Int32 -> Int32 -> Int32 -> Ptr () -> IO Int32
-- hTheme : HTHEME -> CIntPtr
-- iPartId : INT -> Int32
-- iStateId : INT -> Int32
-- iPropId : INT -> Int32
-- pIntList : INTLIST* out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let getthemeintlist =
  foreign "GetThemeIntList"
    (intptr_t @-> int32_t @-> int32_t @-> int32_t @-> (ptr void) @-> returning int32_t)
(* hTheme : HTHEME -> intptr_t *)
(* iPartId : INT -> int32_t *)
(* iStateId : INT -> int32_t *)
(* iPropId : INT -> int32_t *)
(* pIntList : INTLIST* out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library uxtheme (t "UXTHEME.dll"))
(cffi:use-foreign-library uxtheme)

(cffi:defcfun ("GetThemeIntList" get-theme-int-list :convention :stdcall) :int32
  (h-theme :int64)   ; HTHEME
  (i-part-id :int32)   ; INT
  (i-state-id :int32)   ; INT
  (i-prop-id :int32)   ; INT
  (p-int-list :pointer))   ; INTLIST* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $GetThemeIntList = Win32::API::More->new('UXTHEME',
    'int GetThemeIntList(LPARAM hTheme, int iPartId, int iStateId, int iPropId, LPVOID pIntList)');
# my $ret = $GetThemeIntList->Call($hTheme, $iPartId, $iStateId, $iPropId, $pIntList);
# hTheme : HTHEME -> LPARAM
# iPartId : INT -> int
# iStateId : INT -> int
# iPropId : INT -> int
# pIntList : INTLIST* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型