Win32 API 日本語リファレンス
ホームGraphics.Gdi › DrawAnimatedRects

DrawAnimatedRects

関数
矩形が移動するアニメーション効果を描画する。
DLLUSER32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL DrawAnimatedRects(
    HWND hwnd,   // optional
    INT idAni,
    const RECT* lprcFrom,
    const RECT* lprcTo
);

パラメーター

名前方向
hwndHWNDinoptional
idAniINTin
lprcFromRECT*in
lprcToRECT*in

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL DrawAnimatedRects(
    HWND hwnd,   // optional
    INT idAni,
    const RECT* lprcFrom,
    const RECT* lprcTo
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", ExactSpelling = true)]
static extern bool DrawAnimatedRects(
    IntPtr hwnd,   // HWND optional
    int idAni,   // INT
    IntPtr lprcFrom,   // RECT*
    IntPtr lprcTo   // RECT*
);
<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function DrawAnimatedRects(
    hwnd As IntPtr,   ' HWND optional
    idAni As Integer,   ' INT
    lprcFrom As IntPtr,   ' RECT*
    lprcTo As IntPtr   ' RECT*
) As Boolean
End Function
' hwnd : HWND optional
' idAni : INT
' lprcFrom : RECT*
' lprcTo : RECT*
Declare PtrSafe Function DrawAnimatedRects Lib "user32" ( _
    ByVal hwnd As LongPtr, _
    ByVal idAni As Long, _
    ByVal lprcFrom As LongPtr, _
    ByVal lprcTo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DrawAnimatedRects = ctypes.windll.user32.DrawAnimatedRects
DrawAnimatedRects.restype = wintypes.BOOL
DrawAnimatedRects.argtypes = [
    wintypes.HANDLE,  # hwnd : HWND optional
    ctypes.c_int,  # idAni : INT
    ctypes.c_void_p,  # lprcFrom : RECT*
    ctypes.c_void_p,  # lprcTo : RECT*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('USER32.dll')
DrawAnimatedRects = Fiddle::Function.new(
  lib['DrawAnimatedRects'],
  [
    Fiddle::TYPE_VOIDP,  # hwnd : HWND optional
    Fiddle::TYPE_INT,  # idAni : INT
    Fiddle::TYPE_VOIDP,  # lprcFrom : RECT*
    Fiddle::TYPE_VOIDP,  # lprcTo : RECT*
  ],
  Fiddle::TYPE_INT)
#[link(name = "user32")]
extern "system" {
    fn DrawAnimatedRects(
        hwnd: *mut core::ffi::c_void,  // HWND optional
        idAni: i32,  // INT
        lprcFrom: *const RECT,  // RECT*
        lprcTo: *const RECT  // RECT*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll")]
public static extern bool DrawAnimatedRects(IntPtr hwnd, int idAni, IntPtr lprcFrom, IntPtr lprcTo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_DrawAnimatedRects' -Namespace Win32 -PassThru
# $api::DrawAnimatedRects(hwnd, idAni, lprcFrom, lprcTo)
#uselib "USER32.dll"
#func global DrawAnimatedRects "DrawAnimatedRects" sptr, sptr, sptr, sptr
; DrawAnimatedRects hwnd, idAni, varptr(lprcFrom), varptr(lprcTo)   ; 戻り値は stat
; hwnd : HWND optional -> "sptr"
; idAni : INT -> "sptr"
; lprcFrom : RECT* -> "sptr"
; lprcTo : RECT* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "USER32.dll"
#cfunc global DrawAnimatedRects "DrawAnimatedRects" sptr, int, var, var
; res = DrawAnimatedRects(hwnd, idAni, lprcFrom, lprcTo)
; hwnd : HWND optional -> "sptr"
; idAni : INT -> "int"
; lprcFrom : RECT* -> "var"
; lprcTo : RECT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL DrawAnimatedRects(HWND hwnd, INT idAni, RECT* lprcFrom, RECT* lprcTo)
#uselib "USER32.dll"
#cfunc global DrawAnimatedRects "DrawAnimatedRects" intptr, int, var, var
; res = DrawAnimatedRects(hwnd, idAni, lprcFrom, lprcTo)
; hwnd : HWND optional -> "intptr"
; idAni : INT -> "int"
; lprcFrom : RECT* -> "var"
; lprcTo : RECT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procDrawAnimatedRects = user32.NewProc("DrawAnimatedRects")
)

// hwnd (HWND optional), idAni (INT), lprcFrom (RECT*), lprcTo (RECT*)
r1, _, err := procDrawAnimatedRects.Call(
	uintptr(hwnd),
	uintptr(idAni),
	uintptr(lprcFrom),
	uintptr(lprcTo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function DrawAnimatedRects(
  hwnd: THandle;   // HWND optional
  idAni: Integer;   // INT
  lprcFrom: Pointer;   // RECT*
  lprcTo: Pointer   // RECT*
): BOOL; stdcall;
  external 'USER32.dll' name 'DrawAnimatedRects';
result := DllCall("USER32\DrawAnimatedRects"
    , "Ptr", hwnd   ; HWND optional
    , "Int", idAni   ; INT
    , "Ptr", lprcFrom   ; RECT*
    , "Ptr", lprcTo   ; RECT*
    , "Int")   ; return: BOOL
●DrawAnimatedRects(hwnd, idAni, lprcFrom, lprcTo) = DLL("USER32.dll", "bool DrawAnimatedRects(void*, int, void*, void*)")
# 呼び出し: DrawAnimatedRects(hwnd, idAni, lprcFrom, lprcTo)
# hwnd : HWND optional -> "void*"
# idAni : INT -> "int"
# lprcFrom : RECT* -> "void*"
# lprcTo : RECT* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。