ホーム › Media.Multimedia › ICLocate
ICLocate
関数指定形式に対応する映像圧縮ドライバーを検索して開く。
シグネチャ
// MSVFW32.dll
#include <windows.h>
HIC ICLocate(
DWORD fccType,
DWORD fccHandler,
BITMAPINFOHEADER* lpbiIn,
BITMAPINFOHEADER* lpbiOut, // optional
WORD wFlags
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| fccType | DWORD | in |
| fccHandler | DWORD | in |
| lpbiIn | BITMAPINFOHEADER* | in |
| lpbiOut | BITMAPINFOHEADER* | inoptional |
| wFlags | WORD | in |
戻り値の型: HIC
各言語での呼び出し定義
// MSVFW32.dll
#include <windows.h>
HIC ICLocate(
DWORD fccType,
DWORD fccHandler,
BITMAPINFOHEADER* lpbiIn,
BITMAPINFOHEADER* lpbiOut, // optional
WORD wFlags
);[DllImport("MSVFW32.dll", ExactSpelling = true)]
static extern IntPtr ICLocate(
uint fccType, // DWORD
uint fccHandler, // DWORD
IntPtr lpbiIn, // BITMAPINFOHEADER*
IntPtr lpbiOut, // BITMAPINFOHEADER* optional
ushort wFlags // WORD
);<DllImport("MSVFW32.dll", ExactSpelling:=True)>
Public Shared Function ICLocate(
fccType As UInteger, ' DWORD
fccHandler As UInteger, ' DWORD
lpbiIn As IntPtr, ' BITMAPINFOHEADER*
lpbiOut As IntPtr, ' BITMAPINFOHEADER* optional
wFlags As UShort ' WORD
) As IntPtr
End Function' fccType : DWORD
' fccHandler : DWORD
' lpbiIn : BITMAPINFOHEADER*
' lpbiOut : BITMAPINFOHEADER* optional
' wFlags : WORD
Declare PtrSafe Function ICLocate Lib "msvfw32" ( _
ByVal fccType As Long, _
ByVal fccHandler As Long, _
ByVal lpbiIn As LongPtr, _
ByVal lpbiOut As LongPtr, _
ByVal wFlags As Integer) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ICLocate = ctypes.windll.msvfw32.ICLocate
ICLocate.restype = ctypes.c_void_p
ICLocate.argtypes = [
wintypes.DWORD, # fccType : DWORD
wintypes.DWORD, # fccHandler : DWORD
ctypes.c_void_p, # lpbiIn : BITMAPINFOHEADER*
ctypes.c_void_p, # lpbiOut : BITMAPINFOHEADER* optional
ctypes.c_ushort, # wFlags : WORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSVFW32.dll')
ICLocate = Fiddle::Function.new(
lib['ICLocate'],
[
-Fiddle::TYPE_INT, # fccType : DWORD
-Fiddle::TYPE_INT, # fccHandler : DWORD
Fiddle::TYPE_VOIDP, # lpbiIn : BITMAPINFOHEADER*
Fiddle::TYPE_VOIDP, # lpbiOut : BITMAPINFOHEADER* optional
-Fiddle::TYPE_SHORT, # wFlags : WORD
],
Fiddle::TYPE_VOIDP)#[link(name = "msvfw32")]
extern "system" {
fn ICLocate(
fccType: u32, // DWORD
fccHandler: u32, // DWORD
lpbiIn: *mut BITMAPINFOHEADER, // BITMAPINFOHEADER*
lpbiOut: *mut BITMAPINFOHEADER, // BITMAPINFOHEADER* optional
wFlags: u16 // WORD
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSVFW32.dll")]
public static extern IntPtr ICLocate(uint fccType, uint fccHandler, IntPtr lpbiIn, IntPtr lpbiOut, ushort wFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSVFW32_ICLocate' -Namespace Win32 -PassThru
# $api::ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags)#uselib "MSVFW32.dll"
#func global ICLocate "ICLocate" sptr, sptr, sptr, sptr, sptr
; ICLocate fccType, fccHandler, varptr(lpbiIn), varptr(lpbiOut), wFlags ; 戻り値は stat
; fccType : DWORD -> "sptr"
; fccHandler : DWORD -> "sptr"
; lpbiIn : BITMAPINFOHEADER* -> "sptr"
; lpbiOut : BITMAPINFOHEADER* optional -> "sptr"
; wFlags : WORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MSVFW32.dll" #cfunc global ICLocate "ICLocate" int, int, var, var, int ; res = ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags) ; fccType : DWORD -> "int" ; fccHandler : DWORD -> "int" ; lpbiIn : BITMAPINFOHEADER* -> "var" ; lpbiOut : BITMAPINFOHEADER* optional -> "var" ; wFlags : WORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MSVFW32.dll" #cfunc global ICLocate "ICLocate" int, int, sptr, sptr, int ; res = ICLocate(fccType, fccHandler, varptr(lpbiIn), varptr(lpbiOut), wFlags) ; fccType : DWORD -> "int" ; fccHandler : DWORD -> "int" ; lpbiIn : BITMAPINFOHEADER* -> "sptr" ; lpbiOut : BITMAPINFOHEADER* optional -> "sptr" ; wFlags : WORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HIC ICLocate(DWORD fccType, DWORD fccHandler, BITMAPINFOHEADER* lpbiIn, BITMAPINFOHEADER* lpbiOut, WORD wFlags) #uselib "MSVFW32.dll" #cfunc global ICLocate "ICLocate" int, int, var, var, int ; res = ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags) ; fccType : DWORD -> "int" ; fccHandler : DWORD -> "int" ; lpbiIn : BITMAPINFOHEADER* -> "var" ; lpbiOut : BITMAPINFOHEADER* optional -> "var" ; wFlags : WORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HIC ICLocate(DWORD fccType, DWORD fccHandler, BITMAPINFOHEADER* lpbiIn, BITMAPINFOHEADER* lpbiOut, WORD wFlags) #uselib "MSVFW32.dll" #cfunc global ICLocate "ICLocate" int, int, intptr, intptr, int ; res = ICLocate(fccType, fccHandler, varptr(lpbiIn), varptr(lpbiOut), wFlags) ; fccType : DWORD -> "int" ; fccHandler : DWORD -> "int" ; lpbiIn : BITMAPINFOHEADER* -> "intptr" ; lpbiOut : BITMAPINFOHEADER* optional -> "intptr" ; wFlags : WORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
procICLocate = msvfw32.NewProc("ICLocate")
)
// fccType (DWORD), fccHandler (DWORD), lpbiIn (BITMAPINFOHEADER*), lpbiOut (BITMAPINFOHEADER* optional), wFlags (WORD)
r1, _, err := procICLocate.Call(
uintptr(fccType),
uintptr(fccHandler),
uintptr(lpbiIn),
uintptr(lpbiOut),
uintptr(wFlags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HICfunction ICLocate(
fccType: DWORD; // DWORD
fccHandler: DWORD; // DWORD
lpbiIn: Pointer; // BITMAPINFOHEADER*
lpbiOut: Pointer; // BITMAPINFOHEADER* optional
wFlags: Word // WORD
): THandle; stdcall;
external 'MSVFW32.dll' name 'ICLocate';result := DllCall("MSVFW32\ICLocate"
, "UInt", fccType ; DWORD
, "UInt", fccHandler ; DWORD
, "Ptr", lpbiIn ; BITMAPINFOHEADER*
, "Ptr", lpbiOut ; BITMAPINFOHEADER* optional
, "UShort", wFlags ; WORD
, "Ptr") ; return: HIC●ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags) = DLL("MSVFW32.dll", "void* ICLocate(dword, dword, void*, void*, int)")
# 呼び出し: ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags)
# fccType : DWORD -> "dword"
# fccHandler : DWORD -> "dword"
# lpbiIn : BITMAPINFOHEADER* -> "void*"
# lpbiOut : BITMAPINFOHEADER* optional -> "void*"
# wFlags : WORD -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。