ホーム › Media.Multimedia › capCreateCaptureWindowA
capCreateCaptureWindowA
関数ビデオキャプチャ用ウィンドウを作成する(ANSI版)。
シグネチャ
// AVICAP32.dll (ANSI / -A)
#include <windows.h>
HWND capCreateCaptureWindowA(
LPCSTR lpszWindowName,
DWORD dwStyle,
INT x,
INT y,
INT nWidth,
INT nHeight,
HWND hwndParent, // optional
INT nID
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpszWindowName | LPCSTR | in |
| dwStyle | DWORD | in |
| x | INT | in |
| y | INT | in |
| nWidth | INT | in |
| nHeight | INT | in |
| hwndParent | HWND | inoptional |
| nID | INT | in |
戻り値の型: HWND
各言語での呼び出し定義
// AVICAP32.dll (ANSI / -A)
#include <windows.h>
HWND capCreateCaptureWindowA(
LPCSTR lpszWindowName,
DWORD dwStyle,
INT x,
INT y,
INT nWidth,
INT nHeight,
HWND hwndParent, // optional
INT nID
);[DllImport("AVICAP32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern IntPtr capCreateCaptureWindowA(
[MarshalAs(UnmanagedType.LPStr)] string lpszWindowName, // LPCSTR
uint dwStyle, // DWORD
int x, // INT
int y, // INT
int nWidth, // INT
int nHeight, // INT
IntPtr hwndParent, // HWND optional
int nID // INT
);<DllImport("AVICAP32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function capCreateCaptureWindowA(
<MarshalAs(UnmanagedType.LPStr)> lpszWindowName As String, ' LPCSTR
dwStyle As UInteger, ' DWORD
x As Integer, ' INT
y As Integer, ' INT
nWidth As Integer, ' INT
nHeight As Integer, ' INT
hwndParent As IntPtr, ' HWND optional
nID As Integer ' INT
) As IntPtr
End Function' lpszWindowName : LPCSTR
' dwStyle : DWORD
' x : INT
' y : INT
' nWidth : INT
' nHeight : INT
' hwndParent : HWND optional
' nID : INT
Declare PtrSafe Function capCreateCaptureWindowA Lib "avicap32" ( _
ByVal lpszWindowName As String, _
ByVal dwStyle As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal hwndParent As LongPtr, _
ByVal nID As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
capCreateCaptureWindowA = ctypes.windll.avicap32.capCreateCaptureWindowA
capCreateCaptureWindowA.restype = ctypes.c_void_p
capCreateCaptureWindowA.argtypes = [
wintypes.LPCSTR, # lpszWindowName : LPCSTR
wintypes.DWORD, # dwStyle : DWORD
ctypes.c_int, # x : INT
ctypes.c_int, # y : INT
ctypes.c_int, # nWidth : INT
ctypes.c_int, # nHeight : INT
wintypes.HANDLE, # hwndParent : HWND optional
ctypes.c_int, # nID : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('AVICAP32.dll')
capCreateCaptureWindowA = Fiddle::Function.new(
lib['capCreateCaptureWindowA'],
[
Fiddle::TYPE_VOIDP, # lpszWindowName : LPCSTR
-Fiddle::TYPE_INT, # dwStyle : DWORD
Fiddle::TYPE_INT, # x : INT
Fiddle::TYPE_INT, # y : INT
Fiddle::TYPE_INT, # nWidth : INT
Fiddle::TYPE_INT, # nHeight : INT
Fiddle::TYPE_VOIDP, # hwndParent : HWND optional
Fiddle::TYPE_INT, # nID : INT
],
Fiddle::TYPE_VOIDP)#[link(name = "avicap32")]
extern "system" {
fn capCreateCaptureWindowA(
lpszWindowName: *const u8, // LPCSTR
dwStyle: u32, // DWORD
x: i32, // INT
y: i32, // INT
nWidth: i32, // INT
nHeight: i32, // INT
hwndParent: *mut core::ffi::c_void, // HWND optional
nID: i32 // INT
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("AVICAP32.dll", CharSet = CharSet.Ansi)]
public static extern IntPtr capCreateCaptureWindowA([MarshalAs(UnmanagedType.LPStr)] string lpszWindowName, uint dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hwndParent, int nID);
"@
$api = Add-Type -MemberDefinition $sig -Name 'AVICAP32_capCreateCaptureWindowA' -Namespace Win32 -PassThru
# $api::capCreateCaptureWindowA(lpszWindowName, dwStyle, x, y, nWidth, nHeight, hwndParent, nID)#uselib "AVICAP32.dll"
#func global capCreateCaptureWindowA "capCreateCaptureWindowA" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; capCreateCaptureWindowA lpszWindowName, dwStyle, x, y, nWidth, nHeight, hwndParent, nID ; 戻り値は stat
; lpszWindowName : LPCSTR -> "sptr"
; dwStyle : DWORD -> "sptr"
; x : INT -> "sptr"
; y : INT -> "sptr"
; nWidth : INT -> "sptr"
; nHeight : INT -> "sptr"
; hwndParent : HWND optional -> "sptr"
; nID : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "AVICAP32.dll"
#cfunc global capCreateCaptureWindowA "capCreateCaptureWindowA" str, int, int, int, int, int, sptr, int
; res = capCreateCaptureWindowA(lpszWindowName, dwStyle, x, y, nWidth, nHeight, hwndParent, nID)
; lpszWindowName : LPCSTR -> "str"
; dwStyle : DWORD -> "int"
; x : INT -> "int"
; y : INT -> "int"
; nWidth : INT -> "int"
; nHeight : INT -> "int"
; hwndParent : HWND optional -> "sptr"
; nID : INT -> "int"; HWND capCreateCaptureWindowA(LPCSTR lpszWindowName, DWORD dwStyle, INT x, INT y, INT nWidth, INT nHeight, HWND hwndParent, INT nID)
#uselib "AVICAP32.dll"
#cfunc global capCreateCaptureWindowA "capCreateCaptureWindowA" str, int, int, int, int, int, intptr, int
; res = capCreateCaptureWindowA(lpszWindowName, dwStyle, x, y, nWidth, nHeight, hwndParent, nID)
; lpszWindowName : LPCSTR -> "str"
; dwStyle : DWORD -> "int"
; x : INT -> "int"
; y : INT -> "int"
; nWidth : INT -> "int"
; nHeight : INT -> "int"
; hwndParent : HWND optional -> "intptr"
; nID : INT -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
avicap32 = windows.NewLazySystemDLL("AVICAP32.dll")
proccapCreateCaptureWindowA = avicap32.NewProc("capCreateCaptureWindowA")
)
// lpszWindowName (LPCSTR), dwStyle (DWORD), x (INT), y (INT), nWidth (INT), nHeight (INT), hwndParent (HWND optional), nID (INT)
r1, _, err := proccapCreateCaptureWindowA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszWindowName))),
uintptr(dwStyle),
uintptr(x),
uintptr(y),
uintptr(nWidth),
uintptr(nHeight),
uintptr(hwndParent),
uintptr(nID),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HWNDfunction capCreateCaptureWindowA(
lpszWindowName: PAnsiChar; // LPCSTR
dwStyle: DWORD; // DWORD
x: Integer; // INT
y: Integer; // INT
nWidth: Integer; // INT
nHeight: Integer; // INT
hwndParent: THandle; // HWND optional
nID: Integer // INT
): THandle; stdcall;
external 'AVICAP32.dll' name 'capCreateCaptureWindowA';result := DllCall("AVICAP32\capCreateCaptureWindowA"
, "AStr", lpszWindowName ; LPCSTR
, "UInt", dwStyle ; DWORD
, "Int", x ; INT
, "Int", y ; INT
, "Int", nWidth ; INT
, "Int", nHeight ; INT
, "Ptr", hwndParent ; HWND optional
, "Int", nID ; INT
, "Ptr") ; return: HWND●capCreateCaptureWindowA(lpszWindowName, dwStyle, x, y, nWidth, nHeight, hwndParent, nID) = DLL("AVICAP32.dll", "void* capCreateCaptureWindowA(char*, dword, int, int, int, int, void*, int)")
# 呼び出し: capCreateCaptureWindowA(lpszWindowName, dwStyle, x, y, nWidth, nHeight, hwndParent, nID)
# lpszWindowName : LPCSTR -> "char*"
# dwStyle : DWORD -> "dword"
# x : INT -> "int"
# y : INT -> "int"
# nWidth : INT -> "int"
# nHeight : INT -> "int"
# hwndParent : HWND optional -> "void*"
# nID : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。