Win32 API 日本語リファレンス
ホームGraphics.DirectDraw › DDVIDEOPORTNOTIFY

DDVIDEOPORTNOTIFY

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

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

フィールド

フィールドサイズx64x86説明
ApproximateTimeStampLONGLONG8+0+0通知イベントの概算タイムスタンプを示す。
lFieldINT4+8+8対象フィールド番号(偶数/奇数)を示す。
dwSurfaceIndexDWORD4+12+12対象サーフェスのインデックスを示す。
lDoneINT4+16+16処理完了状態を示す値。

各言語での定義

#include <windows.h>

// DDVIDEOPORTNOTIFY  (x64 24 / x86 24 バイト)
typedef struct DDVIDEOPORTNOTIFY {
    LONGLONG ApproximateTimeStamp;
    INT lField;
    DWORD dwSurfaceIndex;
    INT lDone;
} DDVIDEOPORTNOTIFY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDVIDEOPORTNOTIFY
{
    public long ApproximateTimeStamp;
    public int lField;
    public uint dwSurfaceIndex;
    public int lDone;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDVIDEOPORTNOTIFY
    Public ApproximateTimeStamp As Long
    Public lField As Integer
    Public dwSurfaceIndex As UInteger
    Public lDone As Integer
End Structure
import ctypes
from ctypes import wintypes

class DDVIDEOPORTNOTIFY(ctypes.Structure):
    _fields_ = [
        ("ApproximateTimeStamp", ctypes.c_longlong),
        ("lField", ctypes.c_int),
        ("dwSurfaceIndex", wintypes.DWORD),
        ("lDone", ctypes.c_int),
    ]
#[repr(C)]
pub struct DDVIDEOPORTNOTIFY {
    pub ApproximateTimeStamp: i64,
    pub lField: i32,
    pub dwSurfaceIndex: u32,
    pub lDone: i32,
}
import "golang.org/x/sys/windows"

type DDVIDEOPORTNOTIFY struct {
	ApproximateTimeStamp int64
	lField int32
	dwSurfaceIndex uint32
	lDone int32
}
type
  DDVIDEOPORTNOTIFY = record
    ApproximateTimeStamp: Int64;
    lField: Integer;
    dwSurfaceIndex: DWORD;
    lDone: Integer;
  end;
const DDVIDEOPORTNOTIFY = extern struct {
    ApproximateTimeStamp: i64,
    lField: i32,
    dwSurfaceIndex: u32,
    lDone: i32,
};
type
  DDVIDEOPORTNOTIFY {.bycopy.} = object
    ApproximateTimeStamp: int64
    lField: int32
    dwSurfaceIndex: uint32
    lDone: int32
struct DDVIDEOPORTNOTIFY
{
    long ApproximateTimeStamp;
    int lField;
    uint dwSurfaceIndex;
    int lDone;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDVIDEOPORTNOTIFY サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; ApproximateTimeStamp : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; lField : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwSurfaceIndex : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; lDone : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDVIDEOPORTNOTIFY
    #field int64 ApproximateTimeStamp
    #field int lField
    #field int dwSurfaceIndex
    #field int lDone
#endstruct

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