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

CHANNEL_CAPS

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

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

フィールド

フィールドサイズx64x86説明
dwFlagsDWORD4+0+0チャネルの機能を示すフラグ。VCAPS_OVERLAY/SRC_CAN_CLIP等のビット組合せ。
dwSrcRectXModDWORD4+4+4ソース矩形のX座標に許される値の刻み(倍数)を示す。
dwSrcRectYModDWORD4+8+8ソース矩形のY座標に許される値の刻み(倍数)を示す。
dwSrcRectWidthModDWORD4+12+12ソース矩形の幅に許される値の刻み(倍数)を示す。
dwSrcRectHeightModDWORD4+16+16ソース矩形の高さに許される値の刻み(倍数)を示す。
dwDstRectXModDWORD4+20+20出力先矩形のX座標に許される値の刻み(倍数)を示す。
dwDstRectYModDWORD4+24+24出力先矩形のY座標に許される値の刻み(倍数)を示す。
dwDstRectWidthModDWORD4+28+28出力先矩形の幅に許される値の刻み(倍数)を示す。
dwDstRectHeightModDWORD4+32+32出力先矩形の高さに許される値の刻み(倍数)を示す。

各言語での定義

#include <windows.h>

// CHANNEL_CAPS  (x64 36 / x86 36 バイト)
typedef struct CHANNEL_CAPS {
    DWORD dwFlags;
    DWORD dwSrcRectXMod;
    DWORD dwSrcRectYMod;
    DWORD dwSrcRectWidthMod;
    DWORD dwSrcRectHeightMod;
    DWORD dwDstRectXMod;
    DWORD dwDstRectYMod;
    DWORD dwDstRectWidthMod;
    DWORD dwDstRectHeightMod;
} CHANNEL_CAPS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CHANNEL_CAPS
{
    public uint dwFlags;
    public uint dwSrcRectXMod;
    public uint dwSrcRectYMod;
    public uint dwSrcRectWidthMod;
    public uint dwSrcRectHeightMod;
    public uint dwDstRectXMod;
    public uint dwDstRectYMod;
    public uint dwDstRectWidthMod;
    public uint dwDstRectHeightMod;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CHANNEL_CAPS
    Public dwFlags As UInteger
    Public dwSrcRectXMod As UInteger
    Public dwSrcRectYMod As UInteger
    Public dwSrcRectWidthMod As UInteger
    Public dwSrcRectHeightMod As UInteger
    Public dwDstRectXMod As UInteger
    Public dwDstRectYMod As UInteger
    Public dwDstRectWidthMod As UInteger
    Public dwDstRectHeightMod As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CHANNEL_CAPS(ctypes.Structure):
    _fields_ = [
        ("dwFlags", wintypes.DWORD),
        ("dwSrcRectXMod", wintypes.DWORD),
        ("dwSrcRectYMod", wintypes.DWORD),
        ("dwSrcRectWidthMod", wintypes.DWORD),
        ("dwSrcRectHeightMod", wintypes.DWORD),
        ("dwDstRectXMod", wintypes.DWORD),
        ("dwDstRectYMod", wintypes.DWORD),
        ("dwDstRectWidthMod", wintypes.DWORD),
        ("dwDstRectHeightMod", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CHANNEL_CAPS {
    pub dwFlags: u32,
    pub dwSrcRectXMod: u32,
    pub dwSrcRectYMod: u32,
    pub dwSrcRectWidthMod: u32,
    pub dwSrcRectHeightMod: u32,
    pub dwDstRectXMod: u32,
    pub dwDstRectYMod: u32,
    pub dwDstRectWidthMod: u32,
    pub dwDstRectHeightMod: u32,
}
import "golang.org/x/sys/windows"

type CHANNEL_CAPS struct {
	dwFlags uint32
	dwSrcRectXMod uint32
	dwSrcRectYMod uint32
	dwSrcRectWidthMod uint32
	dwSrcRectHeightMod uint32
	dwDstRectXMod uint32
	dwDstRectYMod uint32
	dwDstRectWidthMod uint32
	dwDstRectHeightMod uint32
}
type
  CHANNEL_CAPS = record
    dwFlags: DWORD;
    dwSrcRectXMod: DWORD;
    dwSrcRectYMod: DWORD;
    dwSrcRectWidthMod: DWORD;
    dwSrcRectHeightMod: DWORD;
    dwDstRectXMod: DWORD;
    dwDstRectYMod: DWORD;
    dwDstRectWidthMod: DWORD;
    dwDstRectHeightMod: DWORD;
  end;
const CHANNEL_CAPS = extern struct {
    dwFlags: u32,
    dwSrcRectXMod: u32,
    dwSrcRectYMod: u32,
    dwSrcRectWidthMod: u32,
    dwSrcRectHeightMod: u32,
    dwDstRectXMod: u32,
    dwDstRectYMod: u32,
    dwDstRectWidthMod: u32,
    dwDstRectHeightMod: u32,
};
type
  CHANNEL_CAPS {.bycopy.} = object
    dwFlags: uint32
    dwSrcRectXMod: uint32
    dwSrcRectYMod: uint32
    dwSrcRectWidthMod: uint32
    dwSrcRectHeightMod: uint32
    dwDstRectXMod: uint32
    dwDstRectYMod: uint32
    dwDstRectWidthMod: uint32
    dwDstRectHeightMod: uint32
struct CHANNEL_CAPS
{
    uint dwFlags;
    uint dwSrcRectXMod;
    uint dwSrcRectYMod;
    uint dwSrcRectWidthMod;
    uint dwSrcRectHeightMod;
    uint dwDstRectXMod;
    uint dwDstRectYMod;
    uint dwDstRectWidthMod;
    uint dwDstRectHeightMod;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CHANNEL_CAPS サイズ: 36 バイト(x64)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwSrcRectXMod : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwSrcRectYMod : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwSrcRectWidthMod : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwSrcRectHeightMod : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwDstRectXMod : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwDstRectYMod : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwDstRectWidthMod : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwDstRectHeightMod : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CHANNEL_CAPS
    #field int dwFlags
    #field int dwSrcRectXMod
    #field int dwSrcRectYMod
    #field int dwSrcRectWidthMod
    #field int dwSrcRectHeightMod
    #field int dwDstRectXMod
    #field int dwDstRectYMod
    #field int dwDstRectWidthMod
    #field int dwDstRectHeightMod
#endstruct

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