ホーム › Graphics.Gdi › AXESLISTW
AXESLISTW
構造体サイズ=各フィールドのバイト数(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 | AXISINFOW | 640 | +8 | +8 | 各可変軸の情報を表すAXISINFOW配列。 |
各言語での定義
#include <windows.h>
// AXISINFOW (x64 40 / x86 40 バイト)
typedef struct AXISINFOW {
INT axMinValue;
INT axMaxValue;
WCHAR axAxisName[16];
} AXISINFOW;
// AXESLISTW (x64 648 / x86 648 バイト)
typedef struct AXESLISTW {
DWORD axlReserved;
DWORD axlNumAxes;
AXISINFOW axlAxisInfo[16];
} AXESLISTW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AXISINFOW
{
public int axMinValue;
public int axMaxValue;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] public string axAxisName;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AXESLISTW
{
public uint axlReserved;
public uint axlNumAxes;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public AXISINFOW[] axlAxisInfo;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AXISINFOW
Public axMinValue As Integer
Public axMaxValue As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=16)> Public axAxisName As String
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AXESLISTW
Public axlReserved As UInteger
Public axlNumAxes As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public axlAxisInfo() As AXISINFOW
End Structureimport ctypes
from ctypes import wintypes
class AXISINFOW(ctypes.Structure):
_fields_ = [
("axMinValue", ctypes.c_int),
("axMaxValue", ctypes.c_int),
("axAxisName", ctypes.c_wchar * 16),
]
class AXESLISTW(ctypes.Structure):
_fields_ = [
("axlReserved", wintypes.DWORD),
("axlNumAxes", wintypes.DWORD),
("axlAxisInfo", AXISINFOW * 16),
]#[repr(C)]
pub struct AXISINFOW {
pub axMinValue: i32,
pub axMaxValue: i32,
pub axAxisName: [u16; 16],
}
#[repr(C)]
pub struct AXESLISTW {
pub axlReserved: u32,
pub axlNumAxes: u32,
pub axlAxisInfo: [AXISINFOW; 16],
}import "golang.org/x/sys/windows"
type AXISINFOW struct {
axMinValue int32
axMaxValue int32
axAxisName [16]uint16
}
type AXESLISTW struct {
axlReserved uint32
axlNumAxes uint32
axlAxisInfo [16]AXISINFOW
}type
AXISINFOW = record
axMinValue: Integer;
axMaxValue: Integer;
axAxisName: array[0..15] of WideChar;
end;
AXESLISTW = record
axlReserved: DWORD;
axlNumAxes: DWORD;
axlAxisInfo: array[0..15] of AXISINFOW;
end;const AXISINFOW = extern struct {
axMinValue: i32,
axMaxValue: i32,
axAxisName: [16]u16,
};
const AXESLISTW = extern struct {
axlReserved: u32,
axlNumAxes: u32,
axlAxisInfo: [16]AXISINFOW,
};type
AXISINFOW {.bycopy.} = object
axMinValue: int32
axMaxValue: int32
axAxisName: array[16, uint16]
AXESLISTW {.bycopy.} = object
axlReserved: uint32
axlNumAxes: uint32
axlAxisInfo: array[16, AXISINFOW]struct AXISINFOW
{
int axMinValue;
int axMaxValue;
wchar[16] axAxisName;
}
struct AXESLISTW
{
uint axlReserved;
uint axlNumAxes;
AXISINFOW[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 レイアウト)
; AXESLISTW サイズ: 648 バイト(x64)
dim st, 162 ; 4byte整数×162(構造体サイズ 648 / 4 切り上げ)
; axlReserved : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; axlNumAxes : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; axlAxisInfo : AXISINFOW (+8, 640byte) varptr(st)+8 を基点に操作(640byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global AXISINFOW
#field int axMinValue
#field int axMaxValue
#field wchar axAxisName 16
#endstruct
#defstruct global AXESLISTW
#field int axlReserved
#field int axlNumAxes
#field AXISINFOW axlAxisInfo 16
#endstruct
stdim st, AXESLISTW ; NSTRUCT 変数を確保
st->axlReserved = 100
mes "axlReserved=" + st->axlReserved