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

GetThemeAnimationProperty

関数
テーマのストーリーボードアニメーションのプロパティ値を取得する。
DLLUXTHEME.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT GetThemeAnimationProperty(
    HTHEME hTheme,
    INT iStoryboardId,
    INT iTargetId,
    TA_PROPERTY eProperty,
    void* pvProperty,   // optional
    DWORD cbSize,
    DWORD* pcbSizeOut
);

パラメーター

名前方向
hThemeHTHEMEin
iStoryboardIdINTin
iTargetIdINTin
ePropertyTA_PROPERTYin
pvPropertyvoid*outoptional
cbSizeDWORDin
pcbSizeOutDWORD*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT GetThemeAnimationProperty(
    HTHEME hTheme,
    INT iStoryboardId,
    INT iTargetId,
    TA_PROPERTY eProperty,
    void* pvProperty,   // optional
    DWORD cbSize,
    DWORD* pcbSizeOut
);
[DllImport("UXTHEME.dll", ExactSpelling = true)]
static extern int GetThemeAnimationProperty(
    IntPtr hTheme,   // HTHEME
    int iStoryboardId,   // INT
    int iTargetId,   // INT
    int eProperty,   // TA_PROPERTY
    IntPtr pvProperty,   // void* optional, out
    uint cbSize,   // DWORD
    out uint pcbSizeOut   // DWORD* out
);
<DllImport("UXTHEME.dll", ExactSpelling:=True)>
Public Shared Function GetThemeAnimationProperty(
    hTheme As IntPtr,   ' HTHEME
    iStoryboardId As Integer,   ' INT
    iTargetId As Integer,   ' INT
    eProperty As Integer,   ' TA_PROPERTY
    pvProperty As IntPtr,   ' void* optional, out
    cbSize As UInteger,   ' DWORD
    <Out> ByRef pcbSizeOut As UInteger   ' DWORD* out
) As Integer
End Function
' hTheme : HTHEME
' iStoryboardId : INT
' iTargetId : INT
' eProperty : TA_PROPERTY
' pvProperty : void* optional, out
' cbSize : DWORD
' pcbSizeOut : DWORD* out
Declare PtrSafe Function GetThemeAnimationProperty Lib "uxtheme" ( _
    ByVal hTheme As LongPtr, _
    ByVal iStoryboardId As Long, _
    ByVal iTargetId As Long, _
    ByVal eProperty As Long, _
    ByVal pvProperty As LongPtr, _
    ByVal cbSize As Long, _
    ByRef pcbSizeOut As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetThemeAnimationProperty = ctypes.windll.uxtheme.GetThemeAnimationProperty
GetThemeAnimationProperty.restype = ctypes.c_int
GetThemeAnimationProperty.argtypes = [
    ctypes.c_ssize_t,  # hTheme : HTHEME
    ctypes.c_int,  # iStoryboardId : INT
    ctypes.c_int,  # iTargetId : INT
    ctypes.c_int,  # eProperty : TA_PROPERTY
    ctypes.POINTER(None),  # pvProperty : void* optional, out
    wintypes.DWORD,  # cbSize : DWORD
    ctypes.POINTER(wintypes.DWORD),  # pcbSizeOut : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	uxtheme = windows.NewLazySystemDLL("UXTHEME.dll")
	procGetThemeAnimationProperty = uxtheme.NewProc("GetThemeAnimationProperty")
)

// hTheme (HTHEME), iStoryboardId (INT), iTargetId (INT), eProperty (TA_PROPERTY), pvProperty (void* optional, out), cbSize (DWORD), pcbSizeOut (DWORD* out)
r1, _, err := procGetThemeAnimationProperty.Call(
	uintptr(hTheme),
	uintptr(iStoryboardId),
	uintptr(iTargetId),
	uintptr(eProperty),
	uintptr(pvProperty),
	uintptr(cbSize),
	uintptr(pcbSizeOut),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function GetThemeAnimationProperty(
  hTheme: NativeInt;   // HTHEME
  iStoryboardId: Integer;   // INT
  iTargetId: Integer;   // INT
  eProperty: Integer;   // TA_PROPERTY
  pvProperty: Pointer;   // void* optional, out
  cbSize: DWORD;   // DWORD
  pcbSizeOut: Pointer   // DWORD* out
): Integer; stdcall;
  external 'UXTHEME.dll' name 'GetThemeAnimationProperty';
result := DllCall("UXTHEME\GetThemeAnimationProperty"
    , "Ptr", hTheme   ; HTHEME
    , "Int", iStoryboardId   ; INT
    , "Int", iTargetId   ; INT
    , "Int", eProperty   ; TA_PROPERTY
    , "Ptr", pvProperty   ; void* optional, out
    , "UInt", cbSize   ; DWORD
    , "Ptr", pcbSizeOut   ; DWORD* out
    , "Int")   ; return: HRESULT
●GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut) = DLL("UXTHEME.dll", "int GetThemeAnimationProperty(int, int, int, int, void*, dword, void*)")
# 呼び出し: GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut)
# hTheme : HTHEME -> "int"
# iStoryboardId : INT -> "int"
# iTargetId : INT -> "int"
# eProperty : TA_PROPERTY -> "int"
# pvProperty : void* optional, out -> "void*"
# cbSize : DWORD -> "dword"
# pcbSizeOut : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。