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

DD_SETOVERLAYPOSITIONDATA

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

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

フィールド

フィールドサイズx64x86説明
lpDDDD_DIRECTDRAW_GLOBAL*8/4+0+0対象のDirectDrawグローバルオブジェクトへのポインタ。
lpDDSrcSurfaceDD_SURFACE_LOCAL*8/4+8+4位置を設定するオーバーレイ元サーフェスへのポインタ。
lpDDDestSurfaceDD_SURFACE_LOCAL*8/4+16+8オーバーレイ表示先サーフェスへのポインタ。
lXPosINT4+24+12オーバーレイ左上のX座標をピクセル単位で示す。
lYPosINT4+28+16オーバーレイ左上のY座標をピクセル単位で示す。
ddRValHRESULT4+32+20操作の結果を示すHRESULT。成功時はDD_OK。
SetOverlayPositionvoid*8/4+40+24オーバーレイ位置設定処理を行うコールバック関数へのポインタ。

各言語での定義

#include <windows.h>

// DD_SETOVERLAYPOSITIONDATA  (x64 48 / x86 28 バイト)
typedef struct DD_SETOVERLAYPOSITIONDATA {
    DD_DIRECTDRAW_GLOBAL* lpDD;
    DD_SURFACE_LOCAL* lpDDSrcSurface;
    DD_SURFACE_LOCAL* lpDDDestSurface;
    INT lXPos;
    INT lYPos;
    HRESULT ddRVal;
    void* SetOverlayPosition;
} DD_SETOVERLAYPOSITIONDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_SETOVERLAYPOSITIONDATA
{
    public IntPtr lpDD;
    public IntPtr lpDDSrcSurface;
    public IntPtr lpDDDestSurface;
    public int lXPos;
    public int lYPos;
    public int ddRVal;
    public IntPtr SetOverlayPosition;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_SETOVERLAYPOSITIONDATA
    Public lpDD As IntPtr
    Public lpDDSrcSurface As IntPtr
    Public lpDDDestSurface As IntPtr
    Public lXPos As Integer
    Public lYPos As Integer
    Public ddRVal As Integer
    Public SetOverlayPosition As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DD_SETOVERLAYPOSITIONDATA(ctypes.Structure):
    _fields_ = [
        ("lpDD", ctypes.c_void_p),
        ("lpDDSrcSurface", ctypes.c_void_p),
        ("lpDDDestSurface", ctypes.c_void_p),
        ("lXPos", ctypes.c_int),
        ("lYPos", ctypes.c_int),
        ("ddRVal", ctypes.c_int),
        ("SetOverlayPosition", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DD_SETOVERLAYPOSITIONDATA {
    pub lpDD: *mut core::ffi::c_void,
    pub lpDDSrcSurface: *mut core::ffi::c_void,
    pub lpDDDestSurface: *mut core::ffi::c_void,
    pub lXPos: i32,
    pub lYPos: i32,
    pub ddRVal: i32,
    pub SetOverlayPosition: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DD_SETOVERLAYPOSITIONDATA struct {
	lpDD uintptr
	lpDDSrcSurface uintptr
	lpDDDestSurface uintptr
	lXPos int32
	lYPos int32
	ddRVal int32
	SetOverlayPosition uintptr
}
type
  DD_SETOVERLAYPOSITIONDATA = record
    lpDD: Pointer;
    lpDDSrcSurface: Pointer;
    lpDDDestSurface: Pointer;
    lXPos: Integer;
    lYPos: Integer;
    ddRVal: Integer;
    SetOverlayPosition: Pointer;
  end;
const DD_SETOVERLAYPOSITIONDATA = extern struct {
    lpDD: ?*anyopaque,
    lpDDSrcSurface: ?*anyopaque,
    lpDDDestSurface: ?*anyopaque,
    lXPos: i32,
    lYPos: i32,
    ddRVal: i32,
    SetOverlayPosition: ?*anyopaque,
};
type
  DD_SETOVERLAYPOSITIONDATA {.bycopy.} = object
    lpDD: pointer
    lpDDSrcSurface: pointer
    lpDDDestSurface: pointer
    lXPos: int32
    lYPos: int32
    ddRVal: int32
    SetOverlayPosition: pointer
struct DD_SETOVERLAYPOSITIONDATA
{
    void* lpDD;
    void* lpDDSrcSurface;
    void* lpDDDestSurface;
    int lXPos;
    int lYPos;
    int ddRVal;
    void* SetOverlayPosition;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DD_SETOVERLAYPOSITIONDATA サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_GLOBAL* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; lpDDSrcSurface : DD_SURFACE_LOCAL* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; lpDDDestSurface : DD_SURFACE_LOCAL* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; lXPos : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; lYPos : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ddRVal : HRESULT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; SetOverlayPosition : void* (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DD_SETOVERLAYPOSITIONDATA サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_GLOBAL* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpDDSrcSurface : DD_SURFACE_LOCAL* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lpDDDestSurface : DD_SURFACE_LOCAL* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; lXPos : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; lYPos : INT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ddRVal : HRESULT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; SetOverlayPosition : void* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DD_SETOVERLAYPOSITIONDATA
    #field intptr lpDD
    #field intptr lpDDSrcSurface
    #field intptr lpDDDestSurface
    #field int lXPos
    #field int lYPos
    #field int ddRVal
    #field intptr SetOverlayPosition
#endstruct

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