Win32 API 日本語リファレンス
ホームMedia.Multimedia › CAPSTATUS

CAPSTATUS

構造体
サイズx64: 80 バイト / x86: 76 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
uiImageWidthDWORD4+0+0画像の幅 (ピクセル単位)。
uiImageHeightDWORD4+4+4画像の高さ (ピクセル単位)。
fLiveWindowBOOL4+8+8ライブウィンドウフラグ。ウィンドウがプレビュー方式でビデオを表示している場合、このメンバーの値は TRUE になります。
fOverlayWindowBOOL4+12+12オーバーレイウィンドウフラグ。ウィンドウがハードウェアオーバーレイを使用してビデオを表示している場合、このメンバーの値は TRUE になります。
fScaleBOOL4+16+16入力スケーリングフラグ。プレビューでビデオを表示する際に、ウィンドウが入力ビデオをクライアント領域に合わせて拡大縮小している場合、このメンバーの値は TRUE になります。このパラメーターは、オーバーレイを使用してビデオを表示している場合には効果がありません。
ptScrollPOINT8+20+20ウィンドウのクライアント領域の左上隅に表示されるピクセルの x オフセットおよび y オフセット。
fUsingDefaultPaletteBOOL4+28+28既定のパレットフラグ。キャプチャドライバーが既定のパレットを使用している場合、このメンバーの値は TRUE になります。
fAudioHardwareBOOL4+32+32オーディオハードウェアフラグ。システムに波形オーディオハードウェアがインストールされている場合、このメンバーの値は TRUE になります。
fCapFileExistsBOOL4+36+36キャプチャファイルフラグ。有効なキャプチャファイルが生成されている場合、このメンバーの値は TRUE になります。
dwCurrentVideoFrameDWORD4+40+40現在 (または直近) のストリーミングキャプチャで処理されたフレーム数。この数にはドロップされたフレームも含まれます。
dwCurrentVideoFramesDroppedDWORD4+44+44現在 (または直近) のストリーミングキャプチャでドロップされたフレーム数。フレームのドロップは、キャプチャ速度がフレームをファイルに保存できる速度を超えた場合に発生します。この場合、キャプチャドライバーにはデータを格納するために使用できるバッファーがありません。ドロップされたフレームの代わりに直前のフレームが表示されるため、フレームのドロップが同期に影響することはありません。
dwCurrentWaveSamplesDWORD4+48+48現在 (または直近) のストリーミングキャプチャで処理された波形オーディオサンプルの数。
dwCurrentTimeElapsedMSDWORD4+52+52現在 (または直近) のストリーミングキャプチャの開始からの経過時間 (ミリ秒単位)。
hPalCurrentHPALETTE8/4+56+56現在のパレットへのハンドル。
fCapturingNowBOOL4+64+60キャプチャフラグ。キャプチャが進行中の場合、このメンバーの値は TRUE になります。
dwReturnDWORD4+68+64エラーの戻り値。アプリケーションがエラーコールバック関数をサポートしていない場合に、このメンバーを使用します。
wNumVideoAllocatedDWORD4+72+68割り当てられたビデオバッファーの数。この値は、CAPTUREPARMS 構造体の wNumVideoRequested メンバーで指定された数より少ないことがあります。
wNumAudioAllocatedDWORD4+76+72割り当てられたオーディオバッファーの数。この値は、CAPTUREPARMS 構造体の wNumAudioRequested メンバーで指定された数より少ないことがあります。

公式ドキュメント

CAPSTATUS 構造体は、キャプチャウィンドウの現在の状態を定義します。

解説(Remarks)

キャプチャウィンドウの状態はさまざまなメッセージに応じて変化するため、アプリケーションは、メニュー項目を有効にするとき、キャプチャウィンドウの実際の状態を判断するとき、またはビデオ形式のダイアログボックスを呼び出すときに、この構造体の情報を更新する必要があります。ストリーミングキャプチャ中にアプリケーションが処理を譲る場合、この構造体は dwCurrentVideoFramedwCurrentVideoFramesDroppeddwCurrentWaveSamplesdwCurrentTimeElapsedMS の各メンバーでキャプチャの進行状況を返します。この構造体の内容を更新するには、WM_CAP_GET_STATUS メッセージまたは capGetStatus マクロを使用します。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// POINT  (x64 8 / x86 8 バイト)
typedef struct POINT {
    INT x;
    INT y;
} POINT;

// CAPSTATUS  (x64 80 / x86 76 バイト)
typedef struct CAPSTATUS {
    DWORD uiImageWidth;
    DWORD uiImageHeight;
    BOOL fLiveWindow;
    BOOL fOverlayWindow;
    BOOL fScale;
    POINT ptScroll;
    BOOL fUsingDefaultPalette;
    BOOL fAudioHardware;
    BOOL fCapFileExists;
    DWORD dwCurrentVideoFrame;
    DWORD dwCurrentVideoFramesDropped;
    DWORD dwCurrentWaveSamples;
    DWORD dwCurrentTimeElapsedMS;
    HPALETTE hPalCurrent;
    BOOL fCapturingNow;
    DWORD dwReturn;
    DWORD wNumVideoAllocated;
    DWORD wNumAudioAllocated;
} CAPSTATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
    public int x;
    public int y;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CAPSTATUS
{
    public uint uiImageWidth;
    public uint uiImageHeight;
    [MarshalAs(UnmanagedType.Bool)] public bool fLiveWindow;
    [MarshalAs(UnmanagedType.Bool)] public bool fOverlayWindow;
    [MarshalAs(UnmanagedType.Bool)] public bool fScale;
    public POINT ptScroll;
    [MarshalAs(UnmanagedType.Bool)] public bool fUsingDefaultPalette;
    [MarshalAs(UnmanagedType.Bool)] public bool fAudioHardware;
    [MarshalAs(UnmanagedType.Bool)] public bool fCapFileExists;
    public uint dwCurrentVideoFrame;
    public uint dwCurrentVideoFramesDropped;
    public uint dwCurrentWaveSamples;
    public uint dwCurrentTimeElapsedMS;
    public IntPtr hPalCurrent;
    [MarshalAs(UnmanagedType.Bool)] public bool fCapturingNow;
    public uint dwReturn;
    public uint wNumVideoAllocated;
    public uint wNumAudioAllocated;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
    Public x As Integer
    Public y As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CAPSTATUS
    Public uiImageWidth As UInteger
    Public uiImageHeight As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public fLiveWindow As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fOverlayWindow As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fScale As Boolean
    Public ptScroll As POINT
    <MarshalAs(UnmanagedType.Bool)> Public fUsingDefaultPalette As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fAudioHardware As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public fCapFileExists As Boolean
    Public dwCurrentVideoFrame As UInteger
    Public dwCurrentVideoFramesDropped As UInteger
    Public dwCurrentWaveSamples As UInteger
    Public dwCurrentTimeElapsedMS As UInteger
    Public hPalCurrent As IntPtr
    <MarshalAs(UnmanagedType.Bool)> Public fCapturingNow As Boolean
    Public dwReturn As UInteger
    Public wNumVideoAllocated As UInteger
    Public wNumAudioAllocated As UInteger
End Structure
import ctypes
from ctypes import wintypes

class POINT(ctypes.Structure):
    _fields_ = [
        ("x", ctypes.c_int),
        ("y", ctypes.c_int),
    ]

class CAPSTATUS(ctypes.Structure):
    _fields_ = [
        ("uiImageWidth", wintypes.DWORD),
        ("uiImageHeight", wintypes.DWORD),
        ("fLiveWindow", wintypes.BOOL),
        ("fOverlayWindow", wintypes.BOOL),
        ("fScale", wintypes.BOOL),
        ("ptScroll", POINT),
        ("fUsingDefaultPalette", wintypes.BOOL),
        ("fAudioHardware", wintypes.BOOL),
        ("fCapFileExists", wintypes.BOOL),
        ("dwCurrentVideoFrame", wintypes.DWORD),
        ("dwCurrentVideoFramesDropped", wintypes.DWORD),
        ("dwCurrentWaveSamples", wintypes.DWORD),
        ("dwCurrentTimeElapsedMS", wintypes.DWORD),
        ("hPalCurrent", ctypes.c_void_p),
        ("fCapturingNow", wintypes.BOOL),
        ("dwReturn", wintypes.DWORD),
        ("wNumVideoAllocated", wintypes.DWORD),
        ("wNumAudioAllocated", wintypes.DWORD),
    ]
#[repr(C)]
pub struct POINT {
    pub x: i32,
    pub y: i32,
}

#[repr(C)]
pub struct CAPSTATUS {
    pub uiImageWidth: u32,
    pub uiImageHeight: u32,
    pub fLiveWindow: i32,
    pub fOverlayWindow: i32,
    pub fScale: i32,
    pub ptScroll: POINT,
    pub fUsingDefaultPalette: i32,
    pub fAudioHardware: i32,
    pub fCapFileExists: i32,
    pub dwCurrentVideoFrame: u32,
    pub dwCurrentVideoFramesDropped: u32,
    pub dwCurrentWaveSamples: u32,
    pub dwCurrentTimeElapsedMS: u32,
    pub hPalCurrent: *mut core::ffi::c_void,
    pub fCapturingNow: i32,
    pub dwReturn: u32,
    pub wNumVideoAllocated: u32,
    pub wNumAudioAllocated: u32,
}
import "golang.org/x/sys/windows"

type POINT struct {
	x int32
	y int32
}

type CAPSTATUS struct {
	uiImageWidth uint32
	uiImageHeight uint32
	fLiveWindow int32
	fOverlayWindow int32
	fScale int32
	ptScroll POINT
	fUsingDefaultPalette int32
	fAudioHardware int32
	fCapFileExists int32
	dwCurrentVideoFrame uint32
	dwCurrentVideoFramesDropped uint32
	dwCurrentWaveSamples uint32
	dwCurrentTimeElapsedMS uint32
	hPalCurrent uintptr
	fCapturingNow int32
	dwReturn uint32
	wNumVideoAllocated uint32
	wNumAudioAllocated uint32
}
type
  POINT = record
    x: Integer;
    y: Integer;
  end;

  CAPSTATUS = record
    uiImageWidth: DWORD;
    uiImageHeight: DWORD;
    fLiveWindow: BOOL;
    fOverlayWindow: BOOL;
    fScale: BOOL;
    ptScroll: POINT;
    fUsingDefaultPalette: BOOL;
    fAudioHardware: BOOL;
    fCapFileExists: BOOL;
    dwCurrentVideoFrame: DWORD;
    dwCurrentVideoFramesDropped: DWORD;
    dwCurrentWaveSamples: DWORD;
    dwCurrentTimeElapsedMS: DWORD;
    hPalCurrent: Pointer;
    fCapturingNow: BOOL;
    dwReturn: DWORD;
    wNumVideoAllocated: DWORD;
    wNumAudioAllocated: DWORD;
  end;
const POINT = extern struct {
    x: i32,
    y: i32,
};

const CAPSTATUS = extern struct {
    uiImageWidth: u32,
    uiImageHeight: u32,
    fLiveWindow: i32,
    fOverlayWindow: i32,
    fScale: i32,
    ptScroll: POINT,
    fUsingDefaultPalette: i32,
    fAudioHardware: i32,
    fCapFileExists: i32,
    dwCurrentVideoFrame: u32,
    dwCurrentVideoFramesDropped: u32,
    dwCurrentWaveSamples: u32,
    dwCurrentTimeElapsedMS: u32,
    hPalCurrent: ?*anyopaque,
    fCapturingNow: i32,
    dwReturn: u32,
    wNumVideoAllocated: u32,
    wNumAudioAllocated: u32,
};
type
  POINT {.bycopy.} = object
    x: int32
    y: int32

  CAPSTATUS {.bycopy.} = object
    uiImageWidth: uint32
    uiImageHeight: uint32
    fLiveWindow: int32
    fOverlayWindow: int32
    fScale: int32
    ptScroll: POINT
    fUsingDefaultPalette: int32
    fAudioHardware: int32
    fCapFileExists: int32
    dwCurrentVideoFrame: uint32
    dwCurrentVideoFramesDropped: uint32
    dwCurrentWaveSamples: uint32
    dwCurrentTimeElapsedMS: uint32
    hPalCurrent: pointer
    fCapturingNow: int32
    dwReturn: uint32
    wNumVideoAllocated: uint32
    wNumAudioAllocated: uint32
struct POINT
{
    int x;
    int y;
}

struct CAPSTATUS
{
    uint uiImageWidth;
    uint uiImageHeight;
    int fLiveWindow;
    int fOverlayWindow;
    int fScale;
    POINT ptScroll;
    int fUsingDefaultPalette;
    int fAudioHardware;
    int fCapFileExists;
    uint dwCurrentVideoFrame;
    uint dwCurrentVideoFramesDropped;
    uint dwCurrentWaveSamples;
    uint dwCurrentTimeElapsedMS;
    void* hPalCurrent;
    int fCapturingNow;
    uint dwReturn;
    uint wNumVideoAllocated;
    uint wNumAudioAllocated;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CAPSTATUS サイズ: 76 バイト(x86)
dim st, 19    ; 4byte整数×19(構造体サイズ 76 / 4 切り上げ)
; uiImageWidth : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; uiImageHeight : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; fLiveWindow : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; fOverlayWindow : BOOL (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; fScale : BOOL (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ptScroll : POINT (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; fUsingDefaultPalette : BOOL (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; fAudioHardware : BOOL (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; fCapFileExists : BOOL (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwCurrentVideoFrame : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwCurrentVideoFramesDropped : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; dwCurrentWaveSamples : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwCurrentTimeElapsedMS : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; hPalCurrent : HPALETTE (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; fCapturingNow : BOOL (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; dwReturn : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; wNumVideoAllocated : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; wNumAudioAllocated : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CAPSTATUS サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; uiImageWidth : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; uiImageHeight : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; fLiveWindow : BOOL (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; fOverlayWindow : BOOL (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; fScale : BOOL (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ptScroll : POINT (+20, 8byte)  varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; fUsingDefaultPalette : BOOL (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; fAudioHardware : BOOL (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; fCapFileExists : BOOL (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwCurrentVideoFrame : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwCurrentVideoFramesDropped : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; dwCurrentWaveSamples : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwCurrentTimeElapsedMS : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; hPalCurrent : HPALETTE (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; fCapturingNow : BOOL (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwReturn : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; wNumVideoAllocated : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; wNumAudioAllocated : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINT
    #field int x
    #field int y
#endstruct

#defstruct global CAPSTATUS
    #field int uiImageWidth
    #field int uiImageHeight
    #field bool fLiveWindow
    #field bool fOverlayWindow
    #field bool fScale
    #field POINT ptScroll
    #field bool fUsingDefaultPalette
    #field bool fAudioHardware
    #field bool fCapFileExists
    #field int dwCurrentVideoFrame
    #field int dwCurrentVideoFramesDropped
    #field int dwCurrentWaveSamples
    #field int dwCurrentTimeElapsedMS
    #field intptr hPalCurrent
    #field bool fCapturingNow
    #field int dwReturn
    #field int wNumVideoAllocated
    #field int wNumAudioAllocated
#endstruct

stdim st, CAPSTATUS        ; NSTRUCT 変数を確保
st->uiImageWidth = 100
mes "uiImageWidth=" + st->uiImageWidth