ホーム › UI.Controls › GetThemeStream
GetThemeStream
関数指定プロパティのテーマデータストリームを取得する。
シグネチャ
// UXTHEME.dll
#include <windows.h>
HRESULT GetThemeStream(
HTHEME hTheme,
INT iPartId,
INT iStateId,
INT iPropId,
void** ppvStream,
DWORD* pcbStream, // optional
HINSTANCE hInst // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hTheme | HTHEME | in |
| iPartId | INT | in |
| iStateId | INT | in |
| iPropId | INT | in |
| ppvStream | void** | out |
| pcbStream | DWORD* | outoptional |
| hInst | HINSTANCE | inoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// UXTHEME.dll
#include <windows.h>
HRESULT GetThemeStream(
HTHEME hTheme,
INT iPartId,
INT iStateId,
INT iPropId,
void** ppvStream,
DWORD* pcbStream, // optional
HINSTANCE hInst // optional
);[DllImport("UXTHEME.dll", ExactSpelling = true)]
static extern int GetThemeStream(
IntPtr hTheme, // HTHEME
int iPartId, // INT
int iStateId, // INT
int iPropId, // INT
IntPtr ppvStream, // void** out
IntPtr pcbStream, // DWORD* optional, out
IntPtr hInst // HINSTANCE optional
);<DllImport("UXTHEME.dll", ExactSpelling:=True)>
Public Shared Function GetThemeStream(
hTheme As IntPtr, ' HTHEME
iPartId As Integer, ' INT
iStateId As Integer, ' INT
iPropId As Integer, ' INT
ppvStream As IntPtr, ' void** out
pcbStream As IntPtr, ' DWORD* optional, out
hInst As IntPtr ' HINSTANCE optional
) As Integer
End Function' hTheme : HTHEME
' iPartId : INT
' iStateId : INT
' iPropId : INT
' ppvStream : void** out
' pcbStream : DWORD* optional, out
' hInst : HINSTANCE optional
Declare PtrSafe Function GetThemeStream Lib "uxtheme" ( _
ByVal hTheme As LongPtr, _
ByVal iPartId As Long, _
ByVal iStateId As Long, _
ByVal iPropId As Long, _
ByVal ppvStream As LongPtr, _
ByVal pcbStream As LongPtr, _
ByVal hInst As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetThemeStream = ctypes.windll.uxtheme.GetThemeStream
GetThemeStream.restype = ctypes.c_int
GetThemeStream.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, # ppvStream : void** out
ctypes.POINTER(wintypes.DWORD), # pcbStream : DWORD* optional, out
wintypes.HANDLE, # hInst : HINSTANCE optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('UXTHEME.dll')
GetThemeStream = Fiddle::Function.new(
lib['GetThemeStream'],
[
Fiddle::TYPE_INTPTR_T, # hTheme : HTHEME
Fiddle::TYPE_INT, # iPartId : INT
Fiddle::TYPE_INT, # iStateId : INT
Fiddle::TYPE_INT, # iPropId : INT
Fiddle::TYPE_VOIDP, # ppvStream : void** out
Fiddle::TYPE_VOIDP, # pcbStream : DWORD* optional, out
Fiddle::TYPE_VOIDP, # hInst : HINSTANCE optional
],
Fiddle::TYPE_INT)#[link(name = "uxtheme")]
extern "system" {
fn GetThemeStream(
hTheme: isize, // HTHEME
iPartId: i32, // INT
iStateId: i32, // INT
iPropId: i32, // INT
ppvStream: *mut *mut (), // void** out
pcbStream: *mut u32, // DWORD* optional, out
hInst: *mut core::ffi::c_void // HINSTANCE optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("UXTHEME.dll")]
public static extern int GetThemeStream(IntPtr hTheme, int iPartId, int iStateId, int iPropId, IntPtr ppvStream, IntPtr pcbStream, IntPtr hInst);
"@
$api = Add-Type -MemberDefinition $sig -Name 'UXTHEME_GetThemeStream' -Namespace Win32 -PassThru
# $api::GetThemeStream(hTheme, iPartId, iStateId, iPropId, ppvStream, pcbStream, hInst)#uselib "UXTHEME.dll"
#func global GetThemeStream "GetThemeStream" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; GetThemeStream hTheme, iPartId, iStateId, iPropId, ppvStream, varptr(pcbStream), hInst ; 戻り値は stat
; hTheme : HTHEME -> "sptr"
; iPartId : INT -> "sptr"
; iStateId : INT -> "sptr"
; iPropId : INT -> "sptr"
; ppvStream : void** out -> "sptr"
; pcbStream : DWORD* optional, out -> "sptr"
; hInst : HINSTANCE optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "UXTHEME.dll" #cfunc global GetThemeStream "GetThemeStream" sptr, int, int, int, sptr, var, sptr ; res = GetThemeStream(hTheme, iPartId, iStateId, iPropId, ppvStream, pcbStream, hInst) ; hTheme : HTHEME -> "sptr" ; iPartId : INT -> "int" ; iStateId : INT -> "int" ; iPropId : INT -> "int" ; ppvStream : void** out -> "sptr" ; pcbStream : DWORD* optional, out -> "var" ; hInst : HINSTANCE optional -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "UXTHEME.dll" #cfunc global GetThemeStream "GetThemeStream" sptr, int, int, int, sptr, sptr, sptr ; res = GetThemeStream(hTheme, iPartId, iStateId, iPropId, ppvStream, varptr(pcbStream), hInst) ; hTheme : HTHEME -> "sptr" ; iPartId : INT -> "int" ; iStateId : INT -> "int" ; iPropId : INT -> "int" ; ppvStream : void** out -> "sptr" ; pcbStream : DWORD* optional, out -> "sptr" ; hInst : HINSTANCE optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT GetThemeStream(HTHEME hTheme, INT iPartId, INT iStateId, INT iPropId, void** ppvStream, DWORD* pcbStream, HINSTANCE hInst) #uselib "UXTHEME.dll" #cfunc global GetThemeStream "GetThemeStream" intptr, int, int, int, intptr, var, intptr ; res = GetThemeStream(hTheme, iPartId, iStateId, iPropId, ppvStream, pcbStream, hInst) ; hTheme : HTHEME -> "intptr" ; iPartId : INT -> "int" ; iStateId : INT -> "int" ; iPropId : INT -> "int" ; ppvStream : void** out -> "intptr" ; pcbStream : DWORD* optional, out -> "var" ; hInst : HINSTANCE optional -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT GetThemeStream(HTHEME hTheme, INT iPartId, INT iStateId, INT iPropId, void** ppvStream, DWORD* pcbStream, HINSTANCE hInst) #uselib "UXTHEME.dll" #cfunc global GetThemeStream "GetThemeStream" intptr, int, int, int, intptr, intptr, intptr ; res = GetThemeStream(hTheme, iPartId, iStateId, iPropId, ppvStream, varptr(pcbStream), hInst) ; hTheme : HTHEME -> "intptr" ; iPartId : INT -> "int" ; iStateId : INT -> "int" ; iPropId : INT -> "int" ; ppvStream : void** out -> "intptr" ; pcbStream : DWORD* optional, out -> "intptr" ; hInst : HINSTANCE optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
uxtheme = windows.NewLazySystemDLL("UXTHEME.dll")
procGetThemeStream = uxtheme.NewProc("GetThemeStream")
)
// hTheme (HTHEME), iPartId (INT), iStateId (INT), iPropId (INT), ppvStream (void** out), pcbStream (DWORD* optional, out), hInst (HINSTANCE optional)
r1, _, err := procGetThemeStream.Call(
uintptr(hTheme),
uintptr(iPartId),
uintptr(iStateId),
uintptr(iPropId),
uintptr(ppvStream),
uintptr(pcbStream),
uintptr(hInst),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction GetThemeStream(
hTheme: NativeInt; // HTHEME
iPartId: Integer; // INT
iStateId: Integer; // INT
iPropId: Integer; // INT
ppvStream: Pointer; // void** out
pcbStream: Pointer; // DWORD* optional, out
hInst: THandle // HINSTANCE optional
): Integer; stdcall;
external 'UXTHEME.dll' name 'GetThemeStream';result := DllCall("UXTHEME\GetThemeStream"
, "Ptr", hTheme ; HTHEME
, "Int", iPartId ; INT
, "Int", iStateId ; INT
, "Int", iPropId ; INT
, "Ptr", ppvStream ; void** out
, "Ptr", pcbStream ; DWORD* optional, out
, "Ptr", hInst ; HINSTANCE optional
, "Int") ; return: HRESULT●GetThemeStream(hTheme, iPartId, iStateId, iPropId, ppvStream, pcbStream, hInst) = DLL("UXTHEME.dll", "int GetThemeStream(int, int, int, int, void*, void*, void*)")
# 呼び出し: GetThemeStream(hTheme, iPartId, iStateId, iPropId, ppvStream, pcbStream, hInst)
# hTheme : HTHEME -> "int"
# iPartId : INT -> "int"
# iStateId : INT -> "int"
# iPropId : INT -> "int"
# ppvStream : void** out -> "void*"
# pcbStream : DWORD* optional, out -> "void*"
# hInst : HINSTANCE optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。