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

MagGetWindowTransform

関数
拡大鏡ウィンドウの拡大率変換行列を取得する。
DLLMAGNIFICATION.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

BOOL MagGetWindowTransform(
    HWND hwnd,
    MAGTRANSFORM* pTransform
);

パラメーター

名前方向
hwndHWNDin
pTransformMAGTRANSFORM*inout

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL MagGetWindowTransform(
    HWND hwnd,
    MAGTRANSFORM* pTransform
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("MAGNIFICATION.dll", ExactSpelling = true)]
static extern bool MagGetWindowTransform(
    IntPtr hwnd,   // HWND
    IntPtr pTransform   // MAGTRANSFORM* in/out
);
<DllImport("MAGNIFICATION.dll", ExactSpelling:=True)>
Public Shared Function MagGetWindowTransform(
    hwnd As IntPtr,   ' HWND
    pTransform As IntPtr   ' MAGTRANSFORM* in/out
) As Boolean
End Function
' hwnd : HWND
' pTransform : MAGTRANSFORM* in/out
Declare PtrSafe Function MagGetWindowTransform Lib "magnification" ( _
    ByVal hwnd As LongPtr, _
    ByVal pTransform As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MagGetWindowTransform = ctypes.windll.magnification.MagGetWindowTransform
MagGetWindowTransform.restype = wintypes.BOOL
MagGetWindowTransform.argtypes = [
    wintypes.HANDLE,  # hwnd : HWND
    ctypes.c_void_p,  # pTransform : MAGTRANSFORM* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	magnification = windows.NewLazySystemDLL("MAGNIFICATION.dll")
	procMagGetWindowTransform = magnification.NewProc("MagGetWindowTransform")
)

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