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