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

AXISINFOW

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

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

フィールド

フィールドサイズx64x86説明
axMinValueINT4+0+0可変軸が取りうる最小値を表す。
axMaxValueINT4+4+4可変軸が取りうる最大値を表す。
axAxisNameWCHAR32+8+8軸の名前を表すワイド文字列(固定長バッファ)。

各言語での定義

#include <windows.h>

// AXISINFOW  (x64 40 / x86 40 バイト)
typedef struct AXISINFOW {
    INT axMinValue;
    INT axMaxValue;
    WCHAR axAxisName[16];
} AXISINFOW;
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;
}
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
import ctypes
from ctypes import wintypes

class AXISINFOW(ctypes.Structure):
    _fields_ = [
        ("axMinValue", ctypes.c_int),
        ("axMaxValue", ctypes.c_int),
        ("axAxisName", ctypes.c_wchar * 16),
    ]
#[repr(C)]
pub struct AXISINFOW {
    pub axMinValue: i32,
    pub axMaxValue: i32,
    pub axAxisName: [u16; 16],
}
import "golang.org/x/sys/windows"

type AXISINFOW struct {
	axMinValue int32
	axMaxValue int32
	axAxisName [16]uint16
}
type
  AXISINFOW = record
    axMinValue: Integer;
    axMaxValue: Integer;
    axAxisName: array[0..15] of WideChar;
  end;
const AXISINFOW = extern struct {
    axMinValue: i32,
    axMaxValue: i32,
    axAxisName: [16]u16,
};
type
  AXISINFOW {.bycopy.} = object
    axMinValue: int32
    axMaxValue: int32
    axAxisName: array[16, uint16]
struct AXISINFOW
{
    int axMinValue;
    int axMaxValue;
    wchar[16] axAxisName;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AXISINFOW サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; axMinValue : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; axMaxValue : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; axAxisName : WCHAR (+8, 32byte)  varptr(st)+8 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AXISINFOW
    #field int axMinValue
    #field int axMaxValue
    #field wchar axAxisName 16
#endstruct

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