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