GetThreadDpiHostingBehavior
関数現在のスレッドのDPIホスティング挙動を取得する。
シグネチャ
// USER32.dll
#include <windows.h>
DPI_HOSTING_BEHAVIOR GetThreadDpiHostingBehavior(void);パラメーターなし。戻り値: DPI_HOSTING_BEHAVIOR
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
DPI_HOSTING_BEHAVIOR GetThreadDpiHostingBehavior(void);[DllImport("USER32.dll", ExactSpelling = true)]
static extern int GetThreadDpiHostingBehavior();<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function GetThreadDpiHostingBehavior() As Integer
End FunctionDeclare PtrSafe Function GetThreadDpiHostingBehavior Lib "user32" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetThreadDpiHostingBehavior = ctypes.windll.user32.GetThreadDpiHostingBehavior
GetThreadDpiHostingBehavior.restype = ctypes.c_int
GetThreadDpiHostingBehavior.argtypes = []require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
GetThreadDpiHostingBehavior = Fiddle::Function.new(
lib['GetThreadDpiHostingBehavior'],
[],
Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn GetThreadDpiHostingBehavior() -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("USER32.dll")]
public static extern int GetThreadDpiHostingBehavior();
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_GetThreadDpiHostingBehavior' -Namespace Win32 -PassThru
# $api::GetThreadDpiHostingBehavior()#uselib "USER32.dll"
#func global GetThreadDpiHostingBehavior "GetThreadDpiHostingBehavior"
; GetThreadDpiHostingBehavior ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "USER32.dll"
#cfunc global GetThreadDpiHostingBehavior "GetThreadDpiHostingBehavior"
; res = GetThreadDpiHostingBehavior(); DPI_HOSTING_BEHAVIOR GetThreadDpiHostingBehavior()
#uselib "USER32.dll"
#cfunc global GetThreadDpiHostingBehavior "GetThreadDpiHostingBehavior"
; res = GetThreadDpiHostingBehavior()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procGetThreadDpiHostingBehavior = user32.NewProc("GetThreadDpiHostingBehavior")
)
r1, _, err := procGetThreadDpiHostingBehavior.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DPI_HOSTING_BEHAVIORfunction GetThreadDpiHostingBehavior: Integer; stdcall;
external 'USER32.dll' name 'GetThreadDpiHostingBehavior';result := DllCall("USER32\GetThreadDpiHostingBehavior", "Int")●GetThreadDpiHostingBehavior() = DLL("USER32.dll", "int GetThreadDpiHostingBehavior()")
# 呼び出し: GetThreadDpiHostingBehavior()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。