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

DwmGetGraphicsStreamTransformHint

関数
グラフィックスストリームの変換ヒント行列を取得する。
DLLdwmapi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT DwmGetGraphicsStreamTransformHint(
    DWORD uIndex,
    MilMatrix3x2D* pTransform
);

パラメーター

名前方向
uIndexDWORDin
pTransformMilMatrix3x2D*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DwmGetGraphicsStreamTransformHint(
    DWORD uIndex,
    MilMatrix3x2D* pTransform
);
[DllImport("dwmapi.dll", ExactSpelling = true)]
static extern int DwmGetGraphicsStreamTransformHint(
    uint uIndex,   // DWORD
    IntPtr pTransform   // MilMatrix3x2D* out
);
<DllImport("dwmapi.dll", ExactSpelling:=True)>
Public Shared Function DwmGetGraphicsStreamTransformHint(
    uIndex As UInteger,   ' DWORD
    pTransform As IntPtr   ' MilMatrix3x2D* out
) As Integer
End Function
' uIndex : DWORD
' pTransform : MilMatrix3x2D* out
Declare PtrSafe Function DwmGetGraphicsStreamTransformHint Lib "dwmapi" ( _
    ByVal uIndex As Long, _
    ByVal pTransform As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DwmGetGraphicsStreamTransformHint = ctypes.windll.dwmapi.DwmGetGraphicsStreamTransformHint
DwmGetGraphicsStreamTransformHint.restype = ctypes.c_int
DwmGetGraphicsStreamTransformHint.argtypes = [
    wintypes.DWORD,  # uIndex : DWORD
    ctypes.c_void_p,  # pTransform : MilMatrix3x2D* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dwmapi = windows.NewLazySystemDLL("dwmapi.dll")
	procDwmGetGraphicsStreamTransformHint = dwmapi.NewProc("DwmGetGraphicsStreamTransformHint")
)

// uIndex (DWORD), pTransform (MilMatrix3x2D* out)
r1, _, err := procDwmGetGraphicsStreamTransformHint.Call(
	uintptr(uIndex),
	uintptr(pTransform),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function DwmGetGraphicsStreamTransformHint(
  uIndex: DWORD;   // DWORD
  pTransform: Pointer   // MilMatrix3x2D* out
): Integer; stdcall;
  external 'dwmapi.dll' name 'DwmGetGraphicsStreamTransformHint';
result := DllCall("dwmapi\DwmGetGraphicsStreamTransformHint"
    , "UInt", uIndex   ; DWORD
    , "Ptr", pTransform   ; MilMatrix3x2D* out
    , "Int")   ; return: HRESULT
●DwmGetGraphicsStreamTransformHint(uIndex, pTransform) = DLL("dwmapi.dll", "int DwmGetGraphicsStreamTransformHint(dword, void*)")
# 呼び出し: DwmGetGraphicsStreamTransformHint(uIndex, pTransform)
# uIndex : DWORD -> "dword"
# pTransform : MilMatrix3x2D* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。