ホーム › Graphics.Gdi › DESIGNVECTOR
DESIGNVECTOR
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dvReserved | DWORD | 4 | +0 | +0 | 予約済みフィールド。0x08007664を設定する。 |
| dvNumAxes | DWORD | 4 | +4 | +4 | dvValues配列に含まれる軸の数を表す。最大MM_MAX_NUMAXES個。 |
| dvValues | INT | 64 | +8 | +8 | 各可変軸の値を格納する配列の先頭(可変長)。 |
各言語での定義
#include <windows.h>
// DESIGNVECTOR (x64 72 / x86 72 バイト)
typedef struct DESIGNVECTOR {
DWORD dvReserved;
DWORD dvNumAxes;
INT dvValues[16];
} DESIGNVECTOR;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DESIGNVECTOR
{
public uint dvReserved;
public uint dvNumAxes;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public int[] dvValues;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DESIGNVECTOR
Public dvReserved As UInteger
Public dvNumAxes As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public dvValues() As Integer
End Structureimport ctypes
from ctypes import wintypes
class DESIGNVECTOR(ctypes.Structure):
_fields_ = [
("dvReserved", wintypes.DWORD),
("dvNumAxes", wintypes.DWORD),
("dvValues", ctypes.c_int * 16),
]#[repr(C)]
pub struct DESIGNVECTOR {
pub dvReserved: u32,
pub dvNumAxes: u32,
pub dvValues: [i32; 16],
}import "golang.org/x/sys/windows"
type DESIGNVECTOR struct {
dvReserved uint32
dvNumAxes uint32
dvValues [16]int32
}type
DESIGNVECTOR = record
dvReserved: DWORD;
dvNumAxes: DWORD;
dvValues: array[0..15] of Integer;
end;const DESIGNVECTOR = extern struct {
dvReserved: u32,
dvNumAxes: u32,
dvValues: [16]i32,
};type
DESIGNVECTOR {.bycopy.} = object
dvReserved: uint32
dvNumAxes: uint32
dvValues: array[16, int32]struct DESIGNVECTOR
{
uint dvReserved;
uint dvNumAxes;
int[16] dvValues;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DESIGNVECTOR サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dvReserved : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dvNumAxes : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dvValues : INT (+8, 64byte) varptr(st)+8 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DESIGNVECTOR
#field int dvReserved
#field int dvNumAxes
#field int dvValues 16
#endstruct
stdim st, DESIGNVECTOR ; NSTRUCT 変数を確保
st->dvReserved = 100
mes "dvReserved=" + st->dvReserved