ホーム › Devices.Display › SaveCurrentMonitorSettings
SaveCurrentMonitorSettings
関数モニタの現在設定を不揮発メモリに保存する。
シグネチャ
// dxva2.dll
#include <windows.h>
INT SaveCurrentMonitorSettings(
HANDLE hMonitor
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hMonitor | HANDLE | in |
戻り値の型: INT
各言語での呼び出し定義
// dxva2.dll
#include <windows.h>
INT SaveCurrentMonitorSettings(
HANDLE hMonitor
);[DllImport("dxva2.dll", SetLastError = true, ExactSpelling = true)]
static extern int SaveCurrentMonitorSettings(
IntPtr hMonitor // HANDLE
);<DllImport("dxva2.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SaveCurrentMonitorSettings(
hMonitor As IntPtr ' HANDLE
) As Integer
End Function' hMonitor : HANDLE
Declare PtrSafe Function SaveCurrentMonitorSettings Lib "dxva2" ( _
ByVal hMonitor As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SaveCurrentMonitorSettings = ctypes.windll.dxva2.SaveCurrentMonitorSettings
SaveCurrentMonitorSettings.restype = ctypes.c_int
SaveCurrentMonitorSettings.argtypes = [
wintypes.HANDLE, # hMonitor : HANDLE
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('dxva2.dll')
SaveCurrentMonitorSettings = Fiddle::Function.new(
lib['SaveCurrentMonitorSettings'],
[
Fiddle::TYPE_VOIDP, # hMonitor : HANDLE
],
Fiddle::TYPE_INT)#[link(name = "dxva2")]
extern "system" {
fn SaveCurrentMonitorSettings(
hMonitor: *mut core::ffi::c_void // HANDLE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("dxva2.dll", SetLastError = true)]
public static extern int SaveCurrentMonitorSettings(IntPtr hMonitor);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dxva2_SaveCurrentMonitorSettings' -Namespace Win32 -PassThru
# $api::SaveCurrentMonitorSettings(hMonitor)#uselib "dxva2.dll"
#func global SaveCurrentMonitorSettings "SaveCurrentMonitorSettings" sptr
; SaveCurrentMonitorSettings hMonitor ; 戻り値は stat
; hMonitor : HANDLE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "dxva2.dll"
#cfunc global SaveCurrentMonitorSettings "SaveCurrentMonitorSettings" sptr
; res = SaveCurrentMonitorSettings(hMonitor)
; hMonitor : HANDLE -> "sptr"; INT SaveCurrentMonitorSettings(HANDLE hMonitor)
#uselib "dxva2.dll"
#cfunc global SaveCurrentMonitorSettings "SaveCurrentMonitorSettings" intptr
; res = SaveCurrentMonitorSettings(hMonitor)
; hMonitor : HANDLE -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
dxva2 = windows.NewLazySystemDLL("dxva2.dll")
procSaveCurrentMonitorSettings = dxva2.NewProc("SaveCurrentMonitorSettings")
)
// hMonitor (HANDLE)
r1, _, err := procSaveCurrentMonitorSettings.Call(
uintptr(hMonitor),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction SaveCurrentMonitorSettings(
hMonitor: THandle // HANDLE
): Integer; stdcall;
external 'dxva2.dll' name 'SaveCurrentMonitorSettings';result := DllCall("dxva2\SaveCurrentMonitorSettings"
, "Ptr", hMonitor ; HANDLE
, "Int") ; return: INT●SaveCurrentMonitorSettings(hMonitor) = DLL("dxva2.dll", "int SaveCurrentMonitorSettings(void*)")
# 呼び出し: SaveCurrentMonitorSettings(hMonitor)
# hMonitor : HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。