ホーム › Graphics.Gdi › ValidateRgn
ValidateRgn
関数指定リージョンを有効化して更新領域から除外する。
シグネチャ
// USER32.dll
#include <windows.h>
BOOL ValidateRgn(
HWND hWnd,
HRGN hRgn // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hWnd | HWND | in |
| hRgn | HRGN | inoptional |
戻り値の型: BOOL
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
BOOL ValidateRgn(
HWND hWnd,
HRGN hRgn // optional
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", ExactSpelling = true)]
static extern bool ValidateRgn(
IntPtr hWnd, // HWND
IntPtr hRgn // HRGN optional
);<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function ValidateRgn(
hWnd As IntPtr, ' HWND
hRgn As IntPtr ' HRGN optional
) As Boolean
End Function' hWnd : HWND
' hRgn : HRGN optional
Declare PtrSafe Function ValidateRgn Lib "user32" ( _
ByVal hWnd As LongPtr, _
ByVal hRgn As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ValidateRgn = ctypes.windll.user32.ValidateRgn
ValidateRgn.restype = wintypes.BOOL
ValidateRgn.argtypes = [
wintypes.HANDLE, # hWnd : HWND
wintypes.HANDLE, # hRgn : HRGN optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
ValidateRgn = Fiddle::Function.new(
lib['ValidateRgn'],
[
Fiddle::TYPE_VOIDP, # hWnd : HWND
Fiddle::TYPE_VOIDP, # hRgn : HRGN optional
],
Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn ValidateRgn(
hWnd: *mut core::ffi::c_void, // HWND
hRgn: *mut core::ffi::c_void // HRGN optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll")]
public static extern bool ValidateRgn(IntPtr hWnd, IntPtr hRgn);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_ValidateRgn' -Namespace Win32 -PassThru
# $api::ValidateRgn(hWnd, hRgn)#uselib "USER32.dll"
#func global ValidateRgn "ValidateRgn" sptr, sptr
; ValidateRgn hWnd, hRgn ; 戻り値は stat
; hWnd : HWND -> "sptr"
; hRgn : HRGN optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "USER32.dll"
#cfunc global ValidateRgn "ValidateRgn" sptr, sptr
; res = ValidateRgn(hWnd, hRgn)
; hWnd : HWND -> "sptr"
; hRgn : HRGN optional -> "sptr"; BOOL ValidateRgn(HWND hWnd, HRGN hRgn)
#uselib "USER32.dll"
#cfunc global ValidateRgn "ValidateRgn" intptr, intptr
; res = ValidateRgn(hWnd, hRgn)
; hWnd : HWND -> "intptr"
; hRgn : HRGN optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procValidateRgn = user32.NewProc("ValidateRgn")
)
// hWnd (HWND), hRgn (HRGN optional)
r1, _, err := procValidateRgn.Call(
uintptr(hWnd),
uintptr(hRgn),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction ValidateRgn(
hWnd: THandle; // HWND
hRgn: THandle // HRGN optional
): BOOL; stdcall;
external 'USER32.dll' name 'ValidateRgn';result := DllCall("USER32\ValidateRgn"
, "Ptr", hWnd ; HWND
, "Ptr", hRgn ; HRGN optional
, "Int") ; return: BOOL●ValidateRgn(hWnd, hRgn) = DLL("USER32.dll", "bool ValidateRgn(void*, void*)")
# 呼び出し: ValidateRgn(hWnd, hRgn)
# hWnd : HWND -> "void*"
# hRgn : HRGN optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。