Win32 API 日本語リファレンス
ホームSystem.WindowsProgramming › WinWatchGetClipList

WinWatchGetClipList

関数
監視中ウィンドウのクリップ領域リストを取得する。
DLLDCIMAN32.dll呼出規約winapi

シグネチャ

// DCIMAN32.dll
#include <windows.h>

DWORD WinWatchGetClipList(
    HWINWATCH hWW,
    RECT* prc,
    DWORD size,
    RGNDATA* prd
);

パラメーター

名前方向説明
hWWHWINWATCHin対象の監視ハンドル(HWINWATCH)。
prcRECT*inoutクリップ矩形を受け取るRECTへのポインタ。
sizeDWORDinprdバッファのサイズをバイト単位で指定する。
prdRGNDATA*inoutクリップ領域データを受け取るRGNDATA構造体へのポインタ。

戻り値の型: DWORD

各言語での呼び出し定義

// DCIMAN32.dll
#include <windows.h>

DWORD WinWatchGetClipList(
    HWINWATCH hWW,
    RECT* prc,
    DWORD size,
    RGNDATA* prd
);
[DllImport("DCIMAN32.dll", ExactSpelling = true)]
static extern uint WinWatchGetClipList(
    IntPtr hWW,   // HWINWATCH
    IntPtr prc,   // RECT* in/out
    uint size,   // DWORD
    IntPtr prd   // RGNDATA* in/out
);
<DllImport("DCIMAN32.dll", ExactSpelling:=True)>
Public Shared Function WinWatchGetClipList(
    hWW As IntPtr,   ' HWINWATCH
    prc As IntPtr,   ' RECT* in/out
    size As UInteger,   ' DWORD
    prd As IntPtr   ' RGNDATA* in/out
) As UInteger
End Function
' hWW : HWINWATCH
' prc : RECT* in/out
' size : DWORD
' prd : RGNDATA* in/out
Declare PtrSafe Function WinWatchGetClipList Lib "dciman32" ( _
    ByVal hWW As LongPtr, _
    ByVal prc As LongPtr, _
    ByVal size As Long, _
    ByVal prd As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WinWatchGetClipList = ctypes.windll.dciman32.WinWatchGetClipList
WinWatchGetClipList.restype = wintypes.DWORD
WinWatchGetClipList.argtypes = [
    wintypes.HANDLE,  # hWW : HWINWATCH
    ctypes.c_void_p,  # prc : RECT* in/out
    wintypes.DWORD,  # size : DWORD
    ctypes.c_void_p,  # prd : RGNDATA* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('DCIMAN32.dll')
WinWatchGetClipList = Fiddle::Function.new(
  lib['WinWatchGetClipList'],
  [
    Fiddle::TYPE_VOIDP,  # hWW : HWINWATCH
    Fiddle::TYPE_VOIDP,  # prc : RECT* in/out
    -Fiddle::TYPE_INT,  # size : DWORD
    Fiddle::TYPE_VOIDP,  # prd : RGNDATA* in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "dciman32")]
extern "system" {
    fn WinWatchGetClipList(
        hWW: *mut core::ffi::c_void,  // HWINWATCH
        prc: *mut RECT,  // RECT* in/out
        size: u32,  // DWORD
        prd: *mut RGNDATA  // RGNDATA* in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("DCIMAN32.dll")]
public static extern uint WinWatchGetClipList(IntPtr hWW, IntPtr prc, uint size, IntPtr prd);
"@
$api = Add-Type -MemberDefinition $sig -Name 'DCIMAN32_WinWatchGetClipList' -Namespace Win32 -PassThru
# $api::WinWatchGetClipList(hWW, prc, size, prd)
#uselib "DCIMAN32.dll"
#func global WinWatchGetClipList "WinWatchGetClipList" sptr, sptr, sptr, sptr
; WinWatchGetClipList hWW, varptr(prc), size, varptr(prd)   ; 戻り値は stat
; hWW : HWINWATCH -> "sptr"
; prc : RECT* in/out -> "sptr"
; size : DWORD -> "sptr"
; prd : RGNDATA* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "DCIMAN32.dll"
#cfunc global WinWatchGetClipList "WinWatchGetClipList" sptr, var, int, var
; res = WinWatchGetClipList(hWW, prc, size, prd)
; hWW : HWINWATCH -> "sptr"
; prc : RECT* in/out -> "var"
; size : DWORD -> "int"
; prd : RGNDATA* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD WinWatchGetClipList(HWINWATCH hWW, RECT* prc, DWORD size, RGNDATA* prd)
#uselib "DCIMAN32.dll"
#cfunc global WinWatchGetClipList "WinWatchGetClipList" intptr, var, int, var
; res = WinWatchGetClipList(hWW, prc, size, prd)
; hWW : HWINWATCH -> "intptr"
; prc : RECT* in/out -> "var"
; size : DWORD -> "int"
; prd : RGNDATA* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dciman32 = windows.NewLazySystemDLL("DCIMAN32.dll")
	procWinWatchGetClipList = dciman32.NewProc("WinWatchGetClipList")
)

// hWW (HWINWATCH), prc (RECT* in/out), size (DWORD), prd (RGNDATA* in/out)
r1, _, err := procWinWatchGetClipList.Call(
	uintptr(hWW),
	uintptr(prc),
	uintptr(size),
	uintptr(prd),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function WinWatchGetClipList(
  hWW: THandle;   // HWINWATCH
  prc: Pointer;   // RECT* in/out
  size: DWORD;   // DWORD
  prd: Pointer   // RGNDATA* in/out
): DWORD; stdcall;
  external 'DCIMAN32.dll' name 'WinWatchGetClipList';
result := DllCall("DCIMAN32\WinWatchGetClipList"
    , "Ptr", hWW   ; HWINWATCH
    , "Ptr", prc   ; RECT* in/out
    , "UInt", size   ; DWORD
    , "Ptr", prd   ; RGNDATA* in/out
    , "UInt")   ; return: DWORD
●WinWatchGetClipList(hWW, prc, size, prd) = DLL("DCIMAN32.dll", "dword WinWatchGetClipList(void*, void*, dword, void*)")
# 呼び出し: WinWatchGetClipList(hWW, prc, size, prd)
# hWW : HWINWATCH -> "void*"
# prc : RECT* in/out -> "void*"
# size : DWORD -> "dword"
# prd : RGNDATA* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "dciman32" fn WinWatchGetClipList(
    hWW: ?*anyopaque, // HWINWATCH
    prc: [*c]RECT, // RECT* in/out
    size: u32, // DWORD
    prd: [*c]RGNDATA // RGNDATA* in/out
) callconv(std.os.windows.WINAPI) u32;
proc WinWatchGetClipList(
    hWW: pointer,  # HWINWATCH
    prc: ptr RECT,  # RECT* in/out
    size: uint32,  # DWORD
    prd: ptr RGNDATA  # RGNDATA* in/out
): uint32 {.importc: "WinWatchGetClipList", stdcall, dynlib: "DCIMAN32.dll".}
pragma(lib, "dciman32");
extern(Windows)
uint WinWatchGetClipList(
    void* hWW,   // HWINWATCH
    RECT* prc,   // RECT* in/out
    uint size,   // DWORD
    RGNDATA* prd   // RGNDATA* in/out
);
ccall((:WinWatchGetClipList, "DCIMAN32.dll"), stdcall, UInt32,
      (Ptr{Cvoid}, Ptr{RECT}, UInt32, Ptr{RGNDATA}),
      hWW, prc, size, prd)
# hWW : HWINWATCH -> Ptr{Cvoid}
# prc : RECT* in/out -> Ptr{RECT}
# size : DWORD -> UInt32
# prd : RGNDATA* in/out -> Ptr{RGNDATA}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t WinWatchGetClipList(
    void* hWW,
    void* prc,
    uint32_t size,
    void* prd);
]]
local dciman32 = ffi.load("dciman32")
-- dciman32.WinWatchGetClipList(hWW, prc, size, prd)
-- hWW : HWINWATCH
-- prc : RECT* in/out
-- size : DWORD
-- prd : RGNDATA* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('DCIMAN32.dll');
const WinWatchGetClipList = lib.func('__stdcall', 'WinWatchGetClipList', 'uint32_t', ['void *', 'void *', 'uint32_t', 'void *']);
// WinWatchGetClipList(hWW, prc, size, prd)
// hWW : HWINWATCH -> 'void *'
// prc : RECT* in/out -> 'void *'
// size : DWORD -> 'uint32_t'
// prd : RGNDATA* in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("DCIMAN32.dll", {
  WinWatchGetClipList: { parameters: ["pointer", "pointer", "u32", "pointer"], result: "u32" },
});
// lib.symbols.WinWatchGetClipList(hWW, prc, size, prd)
// hWW : HWINWATCH -> "pointer"
// prc : RECT* in/out -> "pointer"
// size : DWORD -> "u32"
// prd : RGNDATA* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t WinWatchGetClipList(
    void* hWW,
    void* prc,
    uint32_t size,
    void* prd);
C, "DCIMAN32.dll");
// $ffi->WinWatchGetClipList(hWW, prc, size, prd);
// hWW : HWINWATCH
// prc : RECT* in/out
// size : DWORD
// prd : RGNDATA* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Dciman32 extends StdCallLibrary {
    Dciman32 INSTANCE = Native.load("dciman32", Dciman32.class);
    int WinWatchGetClipList(
        Pointer hWW,   // HWINWATCH
        Pointer prc,   // RECT* in/out
        int size,   // DWORD
        Pointer prd   // RGNDATA* in/out
    );
}
@[Link("dciman32")]
lib LibDCIMAN32
  fun WinWatchGetClipList = WinWatchGetClipList(
    hWW : Void*,   # HWINWATCH
    prc : RECT*,   # RECT* in/out
    size : UInt32,   # DWORD
    prd : RGNDATA*   # RGNDATA* in/out
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef WinWatchGetClipListNative = Uint32 Function(Pointer<Void>, Pointer<Void>, Uint32, Pointer<Void>);
typedef WinWatchGetClipListDart = int Function(Pointer<Void>, Pointer<Void>, int, Pointer<Void>);
final WinWatchGetClipList = DynamicLibrary.open('DCIMAN32.dll')
    .lookupFunction<WinWatchGetClipListNative, WinWatchGetClipListDart>('WinWatchGetClipList');
// hWW : HWINWATCH -> Pointer<Void>
// prc : RECT* in/out -> Pointer<Void>
// size : DWORD -> Uint32
// prd : RGNDATA* in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function WinWatchGetClipList(
  hWW: THandle;   // HWINWATCH
  prc: Pointer;   // RECT* in/out
  size: DWORD;   // DWORD
  prd: Pointer   // RGNDATA* in/out
): DWORD; stdcall;
  external 'DCIMAN32.dll' name 'WinWatchGetClipList';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "WinWatchGetClipList"
  c_WinWatchGetClipList :: Ptr () -> Ptr () -> Word32 -> Ptr () -> IO Word32
-- hWW : HWINWATCH -> Ptr ()
-- prc : RECT* in/out -> Ptr ()
-- size : DWORD -> Word32
-- prd : RGNDATA* in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let winwatchgetcliplist =
  foreign "WinWatchGetClipList"
    ((ptr void) @-> (ptr void) @-> uint32_t @-> (ptr void) @-> returning uint32_t)
(* hWW : HWINWATCH -> (ptr void) *)
(* prc : RECT* in/out -> (ptr void) *)
(* size : DWORD -> uint32_t *)
(* prd : RGNDATA* in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library dciman32 (t "DCIMAN32.dll"))
(cffi:use-foreign-library dciman32)

(cffi:defcfun ("WinWatchGetClipList" win-watch-get-clip-list :convention :stdcall) :uint32
  (h-ww :pointer)   ; HWINWATCH
  (prc :pointer)   ; RECT* in/out
  (size :uint32)   ; DWORD
  (prd :pointer))   ; RGNDATA* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $WinWatchGetClipList = Win32::API::More->new('DCIMAN32',
    'DWORD WinWatchGetClipList(HANDLE hWW, LPVOID prc, DWORD size, LPVOID prd)');
# my $ret = $WinWatchGetClipList->Call($hWW, $prc, $size, $prd);
# hWW : HWINWATCH -> HANDLE
# prc : RECT* in/out -> LPVOID
# size : DWORD -> DWORD
# prd : RGNDATA* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型