ホーム › UI.Controls › GetThemeAnimationProperty
GetThemeAnimationProperty
関数テーマのストーリーボードアニメーションのプロパティ値を取得する。
シグネチャ
// UXTHEME.dll
#include <windows.h>
HRESULT GetThemeAnimationProperty(
HTHEME hTheme,
INT iStoryboardId,
INT iTargetId,
TA_PROPERTY eProperty,
void* pvProperty, // optional
DWORD cbSize,
DWORD* pcbSizeOut
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hTheme | HTHEME | in | オープン済みのテーマハンドル。 |
| iStoryboardId | INT | in | 事前定義されたストーリーボード識別子。 |
| iTargetId | INT | in | 事前定義されたターゲット識別子。 |
| eProperty | TA_PROPERTY | in | アニメーションのストーリーボードおよびターゲットに関連付けられたプロパティ。 |
| pvProperty | void* | outoptional | 返されるプロパティ値を受け取るバッファー。 |
| cbSize | DWORD | in | pvProperty が指すバッファーのバイトサイズ。 |
| pcbSizeOut | DWORD* | out | 返されるプロパティのバイトサイズ。 |
戻り値の型: HRESULT
公式ドキュメント
ストーリーボード ID とターゲット ID に基づいてテーマアニメーションのプロパティを取得します。
戻り値
この関数が成功した場合は S_OK を返します。失敗した場合は HRESULT エラーコードを返します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// 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 方式にも切替可。#uselib "UXTHEME.dll" #cfunc global GetThemeAnimationProperty "GetThemeAnimationProperty" sptr, int, int, int, sptr, int, sptr ; res = GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, varptr(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 -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは 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 方式にも切替可。; 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, intptr ; res = GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, varptr(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 -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは 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 // HRESULTfunction 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)。const std = @import("std");
extern "uxtheme" fn GetThemeAnimationProperty(
hTheme: isize, // HTHEME
iStoryboardId: i32, // INT
iTargetId: i32, // INT
eProperty: i32, // TA_PROPERTY
pvProperty: ?*anyopaque, // void* optional, out
cbSize: u32, // DWORD
pcbSizeOut: [*c]u32 // DWORD* out
) callconv(std.os.windows.WINAPI) i32;proc GetThemeAnimationProperty(
hTheme: int, # HTHEME
iStoryboardId: int32, # INT
iTargetId: int32, # INT
eProperty: int32, # TA_PROPERTY
pvProperty: pointer, # void* optional, out
cbSize: uint32, # DWORD
pcbSizeOut: ptr uint32 # DWORD* out
): int32 {.importc: "GetThemeAnimationProperty", stdcall, dynlib: "UXTHEME.dll".}pragma(lib, "uxtheme");
extern(Windows)
int GetThemeAnimationProperty(
ptrdiff_t hTheme, // HTHEME
int iStoryboardId, // INT
int iTargetId, // INT
int eProperty, // TA_PROPERTY
void* pvProperty, // void* optional, out
uint cbSize, // DWORD
uint* pcbSizeOut // DWORD* out
);ccall((:GetThemeAnimationProperty, "UXTHEME.dll"), stdcall, Int32,
(Int, Int32, Int32, Int32, Ptr{Cvoid}, UInt32, Ptr{UInt32}),
hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut)
# hTheme : HTHEME -> Int
# iStoryboardId : INT -> Int32
# iTargetId : INT -> Int32
# eProperty : TA_PROPERTY -> Int32
# pvProperty : void* optional, out -> Ptr{Cvoid}
# cbSize : DWORD -> UInt32
# pcbSizeOut : DWORD* out -> Ptr{UInt32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t GetThemeAnimationProperty(
intptr_t hTheme,
int32_t iStoryboardId,
int32_t iTargetId,
int32_t eProperty,
void* pvProperty,
uint32_t cbSize,
uint32_t* pcbSizeOut);
]]
local uxtheme = ffi.load("uxtheme")
-- uxtheme.GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut)
-- hTheme : HTHEME
-- iStoryboardId : INT
-- iTargetId : INT
-- eProperty : TA_PROPERTY
-- pvProperty : void* optional, out
-- cbSize : DWORD
-- pcbSizeOut : DWORD* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('UXTHEME.dll');
const GetThemeAnimationProperty = lib.func('__stdcall', 'GetThemeAnimationProperty', 'int32_t', ['intptr_t', 'int32_t', 'int32_t', 'int32_t', 'void *', 'uint32_t', 'uint32_t *']);
// GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut)
// hTheme : HTHEME -> 'intptr_t'
// iStoryboardId : INT -> 'int32_t'
// iTargetId : INT -> 'int32_t'
// eProperty : TA_PROPERTY -> 'int32_t'
// pvProperty : void* optional, out -> 'void *'
// cbSize : DWORD -> 'uint32_t'
// pcbSizeOut : DWORD* out -> 'uint32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("UXTHEME.dll", {
GetThemeAnimationProperty: { parameters: ["isize", "i32", "i32", "i32", "pointer", "u32", "pointer"], result: "i32" },
});
// lib.symbols.GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut)
// hTheme : HTHEME -> "isize"
// iStoryboardId : INT -> "i32"
// iTargetId : INT -> "i32"
// eProperty : TA_PROPERTY -> "i32"
// pvProperty : void* optional, out -> "pointer"
// cbSize : DWORD -> "u32"
// pcbSizeOut : DWORD* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t GetThemeAnimationProperty(
intptr_t hTheme,
int32_t iStoryboardId,
int32_t iTargetId,
int32_t eProperty,
void* pvProperty,
uint32_t cbSize,
uint32_t* pcbSizeOut);
C, "UXTHEME.dll");
// $ffi->GetThemeAnimationProperty(hTheme, iStoryboardId, iTargetId, eProperty, pvProperty, cbSize, pcbSizeOut);
// hTheme : HTHEME
// iStoryboardId : INT
// iTargetId : INT
// eProperty : TA_PROPERTY
// pvProperty : void* optional, out
// cbSize : DWORD
// pcbSizeOut : DWORD* 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 GetThemeAnimationProperty(
long hTheme, // HTHEME
int iStoryboardId, // INT
int iTargetId, // INT
int eProperty, // TA_PROPERTY
Pointer pvProperty, // void* optional, out
int cbSize, // DWORD
IntByReference pcbSizeOut // DWORD* out
);
}@[Link("uxtheme")]
lib LibUXTHEME
fun GetThemeAnimationProperty = GetThemeAnimationProperty(
hTheme : LibC::SSizeT, # HTHEME
iStoryboardId : Int32, # INT
iTargetId : Int32, # INT
eProperty : Int32, # TA_PROPERTY
pvProperty : Void*, # void* optional, out
cbSize : UInt32, # DWORD
pcbSizeOut : UInt32* # DWORD* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GetThemeAnimationPropertyNative = Int32 Function(IntPtr, Int32, Int32, Int32, Pointer<Void>, Uint32, Pointer<Uint32>);
typedef GetThemeAnimationPropertyDart = int Function(int, int, int, int, Pointer<Void>, int, Pointer<Uint32>);
final GetThemeAnimationProperty = DynamicLibrary.open('UXTHEME.dll')
.lookupFunction<GetThemeAnimationPropertyNative, GetThemeAnimationPropertyDart>('GetThemeAnimationProperty');
// hTheme : HTHEME -> IntPtr
// iStoryboardId : INT -> Int32
// iTargetId : INT -> Int32
// eProperty : TA_PROPERTY -> Int32
// pvProperty : void* optional, out -> Pointer<Void>
// cbSize : DWORD -> Uint32
// pcbSizeOut : DWORD* out -> Pointer<Uint32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
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';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GetThemeAnimationProperty"
c_GetThemeAnimationProperty :: CIntPtr -> Int32 -> Int32 -> Int32 -> Ptr () -> Word32 -> Ptr Word32 -> IO Int32
-- hTheme : HTHEME -> CIntPtr
-- iStoryboardId : INT -> Int32
-- iTargetId : INT -> Int32
-- eProperty : TA_PROPERTY -> Int32
-- pvProperty : void* optional, out -> Ptr ()
-- cbSize : DWORD -> Word32
-- pcbSizeOut : DWORD* out -> Ptr Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let getthemeanimationproperty =
foreign "GetThemeAnimationProperty"
(intptr_t @-> int32_t @-> int32_t @-> int32_t @-> (ptr void) @-> uint32_t @-> (ptr uint32_t) @-> returning int32_t)
(* hTheme : HTHEME -> intptr_t *)
(* iStoryboardId : INT -> int32_t *)
(* iTargetId : INT -> int32_t *)
(* eProperty : TA_PROPERTY -> int32_t *)
(* pvProperty : void* optional, out -> (ptr void) *)
(* cbSize : DWORD -> uint32_t *)
(* pcbSizeOut : DWORD* out -> (ptr uint32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library uxtheme (t "UXTHEME.dll"))
(cffi:use-foreign-library uxtheme)
(cffi:defcfun ("GetThemeAnimationProperty" get-theme-animation-property :convention :stdcall) :int32
(h-theme :int64) ; HTHEME
(i-storyboard-id :int32) ; INT
(i-target-id :int32) ; INT
(e-property :int32) ; TA_PROPERTY
(pv-property :pointer) ; void* optional, out
(cb-size :uint32) ; DWORD
(pcb-size-out :pointer)) ; DWORD* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GetThemeAnimationProperty = Win32::API::More->new('UXTHEME',
'int GetThemeAnimationProperty(LPARAM hTheme, int iStoryboardId, int iTargetId, int eProperty, LPVOID pvProperty, DWORD cbSize, LPVOID pcbSizeOut)');
# my $ret = $GetThemeAnimationProperty->Call($hTheme, $iStoryboardId, $iTargetId, $eProperty, $pvProperty, $cbSize, $pcbSizeOut);
# hTheme : HTHEME -> LPARAM
# iStoryboardId : INT -> int
# iTargetId : INT -> int
# eProperty : TA_PROPERTY -> int
# pvProperty : void* optional, out -> LPVOID
# cbSize : DWORD -> DWORD
# pcbSizeOut : DWORD* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型