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

RevokeScaleChangeNotifications

関数
スケール変更通知の登録を解除する。
DLLapi-ms-win-shcore-scaling-l1-1-0.dll呼出規約winapi対応OSwindows8.0

シグネチャ

// api-ms-win-shcore-scaling-l1-1-0.dll
#include <windows.h>

HRESULT RevokeScaleChangeNotifications(
    DISPLAY_DEVICE_TYPE displayDevice,
    DWORD dwCookie
);

パラメーター

名前方向
displayDeviceDISPLAY_DEVICE_TYPEin
dwCookieDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

// api-ms-win-shcore-scaling-l1-1-0.dll
#include <windows.h>

HRESULT RevokeScaleChangeNotifications(
    DISPLAY_DEVICE_TYPE displayDevice,
    DWORD dwCookie
);
[DllImport("api-ms-win-shcore-scaling-l1-1-0.dll", ExactSpelling = true)]
static extern int RevokeScaleChangeNotifications(
    int displayDevice,   // DISPLAY_DEVICE_TYPE
    uint dwCookie   // DWORD
);
<DllImport("api-ms-win-shcore-scaling-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Function RevokeScaleChangeNotifications(
    displayDevice As Integer,   ' DISPLAY_DEVICE_TYPE
    dwCookie As UInteger   ' DWORD
) As Integer
End Function
' displayDevice : DISPLAY_DEVICE_TYPE
' dwCookie : DWORD
Declare PtrSafe Function RevokeScaleChangeNotifications Lib "api-ms-win-shcore-scaling-l1-1-0" ( _
    ByVal displayDevice As Long, _
    ByVal dwCookie As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RevokeScaleChangeNotifications = ctypes.windll.LoadLibrary("api-ms-win-shcore-scaling-l1-1-0.dll").RevokeScaleChangeNotifications
RevokeScaleChangeNotifications.restype = ctypes.c_int
RevokeScaleChangeNotifications.argtypes = [
    ctypes.c_int,  # displayDevice : DISPLAY_DEVICE_TYPE
    wintypes.DWORD,  # dwCookie : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-shcore-scaling-l1-1-0.dll')
RevokeScaleChangeNotifications = Fiddle::Function.new(
  lib['RevokeScaleChangeNotifications'],
  [
    Fiddle::TYPE_INT,  # displayDevice : DISPLAY_DEVICE_TYPE
    -Fiddle::TYPE_INT,  # dwCookie : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-shcore-scaling-l1-1-0")]
extern "system" {
    fn RevokeScaleChangeNotifications(
        displayDevice: i32,  // DISPLAY_DEVICE_TYPE
        dwCookie: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("api-ms-win-shcore-scaling-l1-1-0.dll")]
public static extern int RevokeScaleChangeNotifications(int displayDevice, uint dwCookie);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-shcore-scaling-l1-1-0_RevokeScaleChangeNotifications' -Namespace Win32 -PassThru
# $api::RevokeScaleChangeNotifications(displayDevice, dwCookie)
#uselib "api-ms-win-shcore-scaling-l1-1-0.dll"
#func global RevokeScaleChangeNotifications "RevokeScaleChangeNotifications" sptr, sptr
; RevokeScaleChangeNotifications displayDevice, dwCookie   ; 戻り値は stat
; displayDevice : DISPLAY_DEVICE_TYPE -> "sptr"
; dwCookie : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "api-ms-win-shcore-scaling-l1-1-0.dll"
#cfunc global RevokeScaleChangeNotifications "RevokeScaleChangeNotifications" int, int
; res = RevokeScaleChangeNotifications(displayDevice, dwCookie)
; displayDevice : DISPLAY_DEVICE_TYPE -> "int"
; dwCookie : DWORD -> "int"
; HRESULT RevokeScaleChangeNotifications(DISPLAY_DEVICE_TYPE displayDevice, DWORD dwCookie)
#uselib "api-ms-win-shcore-scaling-l1-1-0.dll"
#cfunc global RevokeScaleChangeNotifications "RevokeScaleChangeNotifications" int, int
; res = RevokeScaleChangeNotifications(displayDevice, dwCookie)
; displayDevice : DISPLAY_DEVICE_TYPE -> "int"
; dwCookie : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_shcore_scaling_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-shcore-scaling-l1-1-0.dll")
	procRevokeScaleChangeNotifications = api_ms_win_shcore_scaling_l1_1_0.NewProc("RevokeScaleChangeNotifications")
)

// displayDevice (DISPLAY_DEVICE_TYPE), dwCookie (DWORD)
r1, _, err := procRevokeScaleChangeNotifications.Call(
	uintptr(displayDevice),
	uintptr(dwCookie),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function RevokeScaleChangeNotifications(
  displayDevice: Integer;   // DISPLAY_DEVICE_TYPE
  dwCookie: DWORD   // DWORD
): Integer; stdcall;
  external 'api-ms-win-shcore-scaling-l1-1-0.dll' name 'RevokeScaleChangeNotifications';
result := DllCall("api-ms-win-shcore-scaling-l1-1-0\RevokeScaleChangeNotifications"
    , "Int", displayDevice   ; DISPLAY_DEVICE_TYPE
    , "UInt", dwCookie   ; DWORD
    , "Int")   ; return: HRESULT
●RevokeScaleChangeNotifications(displayDevice, dwCookie) = DLL("api-ms-win-shcore-scaling-l1-1-0.dll", "int RevokeScaleChangeNotifications(int, dword)")
# 呼び出し: RevokeScaleChangeNotifications(displayDevice, dwCookie)
# displayDevice : DISPLAY_DEVICE_TYPE -> "int"
# dwCookie : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。