ホーム › Devices.Display › CLIPOBJ_bEnum
CLIPOBJ_bEnum
関数クリップオブジェクトのクリップ矩形を順に列挙する。
シグネチャ
// GDI32.dll
#include <windows.h>
BOOL CLIPOBJ_bEnum(
CLIPOBJ* pco,
DWORD cj,
DWORD* pul
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pco | CLIPOBJ* | inout |
| cj | DWORD | in |
| pul | DWORD* | inout |
戻り値の型: BOOL
各言語での呼び出し定義
// GDI32.dll
#include <windows.h>
BOOL CLIPOBJ_bEnum(
CLIPOBJ* pco,
DWORD cj,
DWORD* pul
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern bool CLIPOBJ_bEnum(
IntPtr pco, // CLIPOBJ* in/out
uint cj, // DWORD
ref uint pul // DWORD* in/out
);<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function CLIPOBJ_bEnum(
pco As IntPtr, ' CLIPOBJ* in/out
cj As UInteger, ' DWORD
ByRef pul As UInteger ' DWORD* in/out
) As Boolean
End Function' pco : CLIPOBJ* in/out
' cj : DWORD
' pul : DWORD* in/out
Declare PtrSafe Function CLIPOBJ_bEnum Lib "gdi32" ( _
ByVal pco As LongPtr, _
ByVal cj As Long, _
ByRef pul As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CLIPOBJ_bEnum = ctypes.windll.gdi32.CLIPOBJ_bEnum
CLIPOBJ_bEnum.restype = wintypes.BOOL
CLIPOBJ_bEnum.argtypes = [
ctypes.c_void_p, # pco : CLIPOBJ* in/out
wintypes.DWORD, # cj : DWORD
ctypes.POINTER(wintypes.DWORD), # pul : DWORD* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
CLIPOBJ_bEnum = Fiddle::Function.new(
lib['CLIPOBJ_bEnum'],
[
Fiddle::TYPE_VOIDP, # pco : CLIPOBJ* in/out
-Fiddle::TYPE_INT, # cj : DWORD
Fiddle::TYPE_VOIDP, # pul : DWORD* in/out
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn CLIPOBJ_bEnum(
pco: *mut CLIPOBJ, // CLIPOBJ* in/out
cj: u32, // DWORD
pul: *mut u32 // DWORD* in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll")]
public static extern bool CLIPOBJ_bEnum(IntPtr pco, uint cj, ref uint pul);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_CLIPOBJ_bEnum' -Namespace Win32 -PassThru
# $api::CLIPOBJ_bEnum(pco, cj, pul)#uselib "GDI32.dll"
#func global CLIPOBJ_bEnum "CLIPOBJ_bEnum" sptr, sptr, sptr
; CLIPOBJ_bEnum varptr(pco), cj, varptr(pul) ; 戻り値は stat
; pco : CLIPOBJ* in/out -> "sptr"
; cj : DWORD -> "sptr"
; pul : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "GDI32.dll" #cfunc global CLIPOBJ_bEnum "CLIPOBJ_bEnum" var, int, var ; res = CLIPOBJ_bEnum(pco, cj, pul) ; pco : CLIPOBJ* in/out -> "var" ; cj : DWORD -> "int" ; pul : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "GDI32.dll" #cfunc global CLIPOBJ_bEnum "CLIPOBJ_bEnum" sptr, int, sptr ; res = CLIPOBJ_bEnum(varptr(pco), cj, varptr(pul)) ; pco : CLIPOBJ* in/out -> "sptr" ; cj : DWORD -> "int" ; pul : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL CLIPOBJ_bEnum(CLIPOBJ* pco, DWORD cj, DWORD* pul) #uselib "GDI32.dll" #cfunc global CLIPOBJ_bEnum "CLIPOBJ_bEnum" var, int, var ; res = CLIPOBJ_bEnum(pco, cj, pul) ; pco : CLIPOBJ* in/out -> "var" ; cj : DWORD -> "int" ; pul : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL CLIPOBJ_bEnum(CLIPOBJ* pco, DWORD cj, DWORD* pul) #uselib "GDI32.dll" #cfunc global CLIPOBJ_bEnum "CLIPOBJ_bEnum" intptr, int, intptr ; res = CLIPOBJ_bEnum(varptr(pco), cj, varptr(pul)) ; pco : CLIPOBJ* in/out -> "intptr" ; cj : DWORD -> "int" ; pul : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procCLIPOBJ_bEnum = gdi32.NewProc("CLIPOBJ_bEnum")
)
// pco (CLIPOBJ* in/out), cj (DWORD), pul (DWORD* in/out)
r1, _, err := procCLIPOBJ_bEnum.Call(
uintptr(pco),
uintptr(cj),
uintptr(pul),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction CLIPOBJ_bEnum(
pco: Pointer; // CLIPOBJ* in/out
cj: DWORD; // DWORD
pul: Pointer // DWORD* in/out
): BOOL; stdcall;
external 'GDI32.dll' name 'CLIPOBJ_bEnum';result := DllCall("GDI32\CLIPOBJ_bEnum"
, "Ptr", pco ; CLIPOBJ* in/out
, "UInt", cj ; DWORD
, "Ptr", pul ; DWORD* in/out
, "Int") ; return: BOOL●CLIPOBJ_bEnum(pco, cj, pul) = DLL("GDI32.dll", "bool CLIPOBJ_bEnum(void*, dword, void*)")
# 呼び出し: CLIPOBJ_bEnum(pco, cj, pul)
# pco : CLIPOBJ* in/out -> "void*"
# cj : DWORD -> "dword"
# pul : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。