ホーム › UI.Magnification › MagSetWindowSource
MagSetWindowSource
関数拡大鏡ウィンドウが拡大表示する元の領域を設定する。
シグネチャ
// MAGNIFICATION.dll
#include <windows.h>
BOOL MagSetWindowSource(
HWND hwnd,
RECT rect
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hwnd | HWND | in |
| rect | RECT | in |
戻り値の型: BOOL
各言語での呼び出し定義
// MAGNIFICATION.dll
#include <windows.h>
BOOL MagSetWindowSource(
HWND hwnd,
RECT rect
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("MAGNIFICATION.dll", ExactSpelling = true)]
static extern bool MagSetWindowSource(
IntPtr hwnd, // HWND
RECT rect // RECT
);<DllImport("MAGNIFICATION.dll", ExactSpelling:=True)>
Public Shared Function MagSetWindowSource(
hwnd As IntPtr, ' HWND
rect As RECT ' RECT
) As Boolean
End Function' hwnd : HWND
' rect : RECT
Declare PtrSafe Function MagSetWindowSource Lib "magnification" ( _
ByVal hwnd As LongPtr, _
ByVal rect As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MagSetWindowSource = ctypes.windll.magnification.MagSetWindowSource
MagSetWindowSource.restype = wintypes.BOOL
MagSetWindowSource.argtypes = [
wintypes.HANDLE, # hwnd : HWND
RECT, # rect : RECT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MAGNIFICATION.dll')
MagSetWindowSource = Fiddle::Function.new(
lib['MagSetWindowSource'],
[
Fiddle::TYPE_VOIDP, # hwnd : HWND
Fiddle::TYPE_VOIDP, # rect : RECT
],
Fiddle::TYPE_INT)#[link(name = "magnification")]
extern "system" {
fn MagSetWindowSource(
hwnd: *mut core::ffi::c_void, // HWND
rect: RECT // RECT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("MAGNIFICATION.dll")]
public static extern bool MagSetWindowSource(IntPtr hwnd, RECT rect);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAGNIFICATION_MagSetWindowSource' -Namespace Win32 -PassThru
# $api::MagSetWindowSource(hwnd, rect)#uselib "MAGNIFICATION.dll"
#func global MagSetWindowSource "MagSetWindowSource" sptr, sptr
; MagSetWindowSource hwnd, rect ; 戻り値は stat
; hwnd : HWND -> "sptr"
; rect : RECT -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MAGNIFICATION.dll"
#cfunc global MagSetWindowSource "MagSetWindowSource" sptr, int
; res = MagSetWindowSource(hwnd, rect)
; hwnd : HWND -> "sptr"
; rect : RECT -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。; BOOL MagSetWindowSource(HWND hwnd, RECT rect)
#uselib "MAGNIFICATION.dll"
#cfunc global MagSetWindowSource "MagSetWindowSource" intptr, int
; res = MagSetWindowSource(hwnd, rect)
; hwnd : HWND -> "intptr"
; rect : RECT -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
magnification = windows.NewLazySystemDLL("MAGNIFICATION.dll")
procMagSetWindowSource = magnification.NewProc("MagSetWindowSource")
)
// hwnd (HWND), rect (RECT)
r1, _, err := procMagSetWindowSource.Call(
uintptr(hwnd),
uintptr(rect),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction MagSetWindowSource(
hwnd: THandle; // HWND
rect: RECT // RECT
): BOOL; stdcall;
external 'MAGNIFICATION.dll' name 'MagSetWindowSource';result := DllCall("MAGNIFICATION\MagSetWindowSource"
, "Ptr", hwnd ; HWND
, "Ptr", rect ; RECT
, "Int") ; return: BOOL●MagSetWindowSource(hwnd, rect) = DLL("MAGNIFICATION.dll", "bool MagSetWindowSource(void*, void*)")
# 呼び出し: MagSetWindowSource(hwnd, rect)
# hwnd : HWND -> "void*"
# rect : RECT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。