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