ホーム › Media.Multimedia › ICOpen
ICOpen
関数指定種別の映像圧縮ドライバーを開く。
シグネチャ
// MSVFW32.dll
#include <windows.h>
HIC ICOpen(
DWORD fccType,
DWORD fccHandler,
DWORD wMode
);パラメーター
| 名前 | 型 | 方向 | 説明 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| fccType | DWORD | in | 開くコンプレッサーまたはデコンプレッサーの種類を示す 4 文字コード。ビデオストリームの場合、このパラメーターの値は "VIDC" です。 | ||||||||||||||
| fccHandler | DWORD | in | 指定した種類の優先ハンドラー。通常、ハンドラーの種類は AVI ファイルのストリームヘッダーに格納されています。 | ||||||||||||||
| wMode | DWORD | in | コンプレッサーまたはデコンプレッサーの用途を定義するフラグ。次の値が定義されています。
|
戻り値の型: HIC
公式ドキュメント
ICOpen 関数は、コンプレッサーまたはデコンプレッサーを開きます。
戻り値
成功した場合はコンプレッサーまたはデコンプレッサーへのハンドルを返し、それ以外の場合はゼロを返します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// MSVFW32.dll
#include <windows.h>
HIC ICOpen(
DWORD fccType,
DWORD fccHandler,
DWORD wMode
);[DllImport("MSVFW32.dll", ExactSpelling = true)]
static extern IntPtr ICOpen(
uint fccType, // DWORD
uint fccHandler, // DWORD
uint wMode // DWORD
);<DllImport("MSVFW32.dll", ExactSpelling:=True)>
Public Shared Function ICOpen(
fccType As UInteger, ' DWORD
fccHandler As UInteger, ' DWORD
wMode As UInteger ' DWORD
) As IntPtr
End Function' fccType : DWORD
' fccHandler : DWORD
' wMode : DWORD
Declare PtrSafe Function ICOpen Lib "msvfw32" ( _
ByVal fccType As Long, _
ByVal fccHandler As Long, _
ByVal wMode As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ICOpen = ctypes.windll.msvfw32.ICOpen
ICOpen.restype = ctypes.c_void_p
ICOpen.argtypes = [
wintypes.DWORD, # fccType : DWORD
wintypes.DWORD, # fccHandler : DWORD
wintypes.DWORD, # wMode : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSVFW32.dll')
ICOpen = Fiddle::Function.new(
lib['ICOpen'],
[
-Fiddle::TYPE_INT, # fccType : DWORD
-Fiddle::TYPE_INT, # fccHandler : DWORD
-Fiddle::TYPE_INT, # wMode : DWORD
],
Fiddle::TYPE_VOIDP)#[link(name = "msvfw32")]
extern "system" {
fn ICOpen(
fccType: u32, // DWORD
fccHandler: u32, // DWORD
wMode: u32 // DWORD
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSVFW32.dll")]
public static extern IntPtr ICOpen(uint fccType, uint fccHandler, uint wMode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSVFW32_ICOpen' -Namespace Win32 -PassThru
# $api::ICOpen(fccType, fccHandler, wMode)#uselib "MSVFW32.dll"
#func global ICOpen "ICOpen" sptr, sptr, sptr
; ICOpen fccType, fccHandler, wMode ; 戻り値は stat
; fccType : DWORD -> "sptr"
; fccHandler : DWORD -> "sptr"
; wMode : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSVFW32.dll"
#cfunc global ICOpen "ICOpen" int, int, int
; res = ICOpen(fccType, fccHandler, wMode)
; fccType : DWORD -> "int"
; fccHandler : DWORD -> "int"
; wMode : DWORD -> "int"; HIC ICOpen(DWORD fccType, DWORD fccHandler, DWORD wMode)
#uselib "MSVFW32.dll"
#cfunc global ICOpen "ICOpen" int, int, int
; res = ICOpen(fccType, fccHandler, wMode)
; fccType : DWORD -> "int"
; fccHandler : DWORD -> "int"
; wMode : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msvfw32 = windows.NewLazySystemDLL("MSVFW32.dll")
procICOpen = msvfw32.NewProc("ICOpen")
)
// fccType (DWORD), fccHandler (DWORD), wMode (DWORD)
r1, _, err := procICOpen.Call(
uintptr(fccType),
uintptr(fccHandler),
uintptr(wMode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HICfunction ICOpen(
fccType: DWORD; // DWORD
fccHandler: DWORD; // DWORD
wMode: DWORD // DWORD
): THandle; stdcall;
external 'MSVFW32.dll' name 'ICOpen';result := DllCall("MSVFW32\ICOpen"
, "UInt", fccType ; DWORD
, "UInt", fccHandler ; DWORD
, "UInt", wMode ; DWORD
, "Ptr") ; return: HIC●ICOpen(fccType, fccHandler, wMode) = DLL("MSVFW32.dll", "void* ICOpen(dword, dword, dword)")
# 呼び出し: ICOpen(fccType, fccHandler, wMode)
# fccType : DWORD -> "dword"
# fccHandler : DWORD -> "dword"
# wMode : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "msvfw32" fn ICOpen(
fccType: u32, // DWORD
fccHandler: u32, // DWORD
wMode: u32 // DWORD
) callconv(std.os.windows.WINAPI) ?*anyopaque;proc ICOpen(
fccType: uint32, # DWORD
fccHandler: uint32, # DWORD
wMode: uint32 # DWORD
): pointer {.importc: "ICOpen", stdcall, dynlib: "MSVFW32.dll".}pragma(lib, "msvfw32");
extern(Windows)
void* ICOpen(
uint fccType, // DWORD
uint fccHandler, // DWORD
uint wMode // DWORD
);ccall((:ICOpen, "MSVFW32.dll"), stdcall, Ptr{Cvoid},
(UInt32, UInt32, UInt32),
fccType, fccHandler, wMode)
# fccType : DWORD -> UInt32
# fccHandler : DWORD -> UInt32
# wMode : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
void* ICOpen(
uint32_t fccType,
uint32_t fccHandler,
uint32_t wMode);
]]
local msvfw32 = ffi.load("msvfw32")
-- msvfw32.ICOpen(fccType, fccHandler, wMode)
-- fccType : DWORD
-- fccHandler : DWORD
-- wMode : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('MSVFW32.dll');
const ICOpen = lib.func('__stdcall', 'ICOpen', 'void *', ['uint32_t', 'uint32_t', 'uint32_t']);
// ICOpen(fccType, fccHandler, wMode)
// fccType : DWORD -> 'uint32_t'
// fccHandler : DWORD -> 'uint32_t'
// wMode : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("MSVFW32.dll", {
ICOpen: { parameters: ["u32", "u32", "u32"], result: "pointer" },
});
// lib.symbols.ICOpen(fccType, fccHandler, wMode)
// fccType : DWORD -> "u32"
// fccHandler : DWORD -> "u32"
// wMode : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void* ICOpen(
uint32_t fccType,
uint32_t fccHandler,
uint32_t wMode);
C, "MSVFW32.dll");
// $ffi->ICOpen(fccType, fccHandler, wMode);
// fccType : DWORD
// fccHandler : DWORD
// wMode : DWORD
// 構造体/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 Msvfw32 extends StdCallLibrary {
Msvfw32 INSTANCE = Native.load("msvfw32", Msvfw32.class);
Pointer ICOpen(
int fccType, // DWORD
int fccHandler, // DWORD
int wMode // DWORD
);
}@[Link("msvfw32")]
lib LibMSVFW32
fun ICOpen = ICOpen(
fccType : UInt32, # DWORD
fccHandler : UInt32, # DWORD
wMode : UInt32 # DWORD
) : Void*
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ICOpenNative = Pointer<Void> Function(Uint32, Uint32, Uint32);
typedef ICOpenDart = Pointer<Void> Function(int, int, int);
final ICOpen = DynamicLibrary.open('MSVFW32.dll')
.lookupFunction<ICOpenNative, ICOpenDart>('ICOpen');
// fccType : DWORD -> Uint32
// fccHandler : DWORD -> Uint32
// wMode : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ICOpen(
fccType: DWORD; // DWORD
fccHandler: DWORD; // DWORD
wMode: DWORD // DWORD
): THandle; stdcall;
external 'MSVFW32.dll' name 'ICOpen';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "ICOpen"
c_ICOpen :: Word32 -> Word32 -> Word32 -> IO (Ptr ())
-- fccType : DWORD -> Word32
-- fccHandler : DWORD -> Word32
-- wMode : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let icopen =
foreign "ICOpen"
(uint32_t @-> uint32_t @-> uint32_t @-> returning (ptr void))
(* fccType : DWORD -> uint32_t *)
(* fccHandler : DWORD -> uint32_t *)
(* wMode : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library msvfw32 (t "MSVFW32.dll"))
(cffi:use-foreign-library msvfw32)
(cffi:defcfun ("ICOpen" icopen :convention :stdcall) :pointer
(fcc-type :uint32) ; DWORD
(fcc-handler :uint32) ; DWORD
(w-mode :uint32)) ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ICOpen = Win32::API::More->new('MSVFW32',
'HANDLE ICOpen(DWORD fccType, DWORD fccHandler, DWORD wMode)');
# my $ret = $ICOpen->Call($fccType, $fccHandler, $wMode);
# fccType : DWORD -> DWORD
# fccHandler : DWORD -> DWORD
# wMode : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。