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

DCIBeginAccess

関数
DCIサーフェスの指定領域への直接アクセスを開始する。
DLLDCIMAN32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

INT DCIBeginAccess(
    DCISURFACEINFO* pdci,
    INT x,
    INT y,
    INT dx,
    INT dy
);

パラメーター

名前方向
pdciDCISURFACEINFO*inout
xINTin
yINTin
dxINTin
dyINTin

戻り値の型: INT

各言語での呼び出し定義

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

INT DCIBeginAccess(
    DCISURFACEINFO* pdci,
    INT x,
    INT y,
    INT dx,
    INT dy
);
[DllImport("DCIMAN32.dll", ExactSpelling = true)]
static extern int DCIBeginAccess(
    IntPtr pdci,   // DCISURFACEINFO* in/out
    int x,   // INT
    int y,   // INT
    int dx,   // INT
    int dy   // INT
);
<DllImport("DCIMAN32.dll", ExactSpelling:=True)>
Public Shared Function DCIBeginAccess(
    pdci As IntPtr,   ' DCISURFACEINFO* in/out
    x As Integer,   ' INT
    y As Integer,   ' INT
    dx As Integer,   ' INT
    dy As Integer   ' INT
) As Integer
End Function
' pdci : DCISURFACEINFO* in/out
' x : INT
' y : INT
' dx : INT
' dy : INT
Declare PtrSafe Function DCIBeginAccess Lib "dciman32" ( _
    ByVal pdci As LongPtr, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal dx As Long, _
    ByVal dy As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DCIBeginAccess = ctypes.windll.dciman32.DCIBeginAccess
DCIBeginAccess.restype = ctypes.c_int
DCIBeginAccess.argtypes = [
    ctypes.c_void_p,  # pdci : DCISURFACEINFO* in/out
    ctypes.c_int,  # x : INT
    ctypes.c_int,  # y : INT
    ctypes.c_int,  # dx : INT
    ctypes.c_int,  # dy : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dciman32 = windows.NewLazySystemDLL("DCIMAN32.dll")
	procDCIBeginAccess = dciman32.NewProc("DCIBeginAccess")
)

// pdci (DCISURFACEINFO* in/out), x (INT), y (INT), dx (INT), dy (INT)
r1, _, err := procDCIBeginAccess.Call(
	uintptr(pdci),
	uintptr(x),
	uintptr(y),
	uintptr(dx),
	uintptr(dy),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function DCIBeginAccess(
  pdci: Pointer;   // DCISURFACEINFO* in/out
  x: Integer;   // INT
  y: Integer;   // INT
  dx: Integer;   // INT
  dy: Integer   // INT
): Integer; stdcall;
  external 'DCIMAN32.dll' name 'DCIBeginAccess';
result := DllCall("DCIMAN32\DCIBeginAccess"
    , "Ptr", pdci   ; DCISURFACEINFO* in/out
    , "Int", x   ; INT
    , "Int", y   ; INT
    , "Int", dx   ; INT
    , "Int", dy   ; INT
    , "Int")   ; return: INT
●DCIBeginAccess(pdci, x, y, dx, dy) = DLL("DCIMAN32.dll", "int DCIBeginAccess(void*, int, int, int, int)")
# 呼び出し: DCIBeginAccess(pdci, x, y, dx, dy)
# pdci : DCISURFACEINFO* in/out -> "void*"
# x : INT -> "int"
# y : INT -> "int"
# dx : INT -> "int"
# dy : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。