ホーム › Devices.HumanInterfaceDevice › DIPROPCALPOV
DIPROPCALPOV
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| diph | DIPROPHEADER | 16 | +0 | +0 | プロパティ共通ヘッダー(DIPROPHEADER)。 |
| lMin | INT | 20 | +16 | +16 | POVキャリブレーションの最小値。 |
| lMax | INT | 20 | +36 | +36 | POVキャリブレーションの最大値。 |
各言語での定義
#include <windows.h>
// DIPROPHEADER (x64 16 / x86 16 バイト)
typedef struct DIPROPHEADER {
DWORD dwSize;
DWORD dwHeaderSize;
DWORD dwObj;
DWORD dwHow;
} DIPROPHEADER;
// DIPROPCALPOV (x64 56 / x86 56 バイト)
typedef struct DIPROPCALPOV {
DIPROPHEADER diph;
INT lMin[5];
INT lMax[5];
} DIPROPCALPOV;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DIPROPHEADER
{
public uint dwSize;
public uint dwHeaderSize;
public uint dwObj;
public uint dwHow;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DIPROPCALPOV
{
public DIPROPHEADER diph;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public int[] lMin;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public int[] lMax;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DIPROPHEADER
Public dwSize As UInteger
Public dwHeaderSize As UInteger
Public dwObj As UInteger
Public dwHow As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DIPROPCALPOV
Public diph As DIPROPHEADER
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=5)> Public lMin() As Integer
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=5)> Public lMax() As Integer
End Structureimport ctypes
from ctypes import wintypes
class DIPROPHEADER(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwHeaderSize", wintypes.DWORD),
("dwObj", wintypes.DWORD),
("dwHow", wintypes.DWORD),
]
class DIPROPCALPOV(ctypes.Structure):
_fields_ = [
("diph", DIPROPHEADER),
("lMin", ctypes.c_int * 5),
("lMax", ctypes.c_int * 5),
]#[repr(C)]
pub struct DIPROPHEADER {
pub dwSize: u32,
pub dwHeaderSize: u32,
pub dwObj: u32,
pub dwHow: u32,
}
#[repr(C)]
pub struct DIPROPCALPOV {
pub diph: DIPROPHEADER,
pub lMin: [i32; 5],
pub lMax: [i32; 5],
}import "golang.org/x/sys/windows"
type DIPROPHEADER struct {
dwSize uint32
dwHeaderSize uint32
dwObj uint32
dwHow uint32
}
type DIPROPCALPOV struct {
diph DIPROPHEADER
lMin [5]int32
lMax [5]int32
}type
DIPROPHEADER = record
dwSize: DWORD;
dwHeaderSize: DWORD;
dwObj: DWORD;
dwHow: DWORD;
end;
DIPROPCALPOV = record
diph: DIPROPHEADER;
lMin: array[0..4] of Integer;
lMax: array[0..4] of Integer;
end;const DIPROPHEADER = extern struct {
dwSize: u32,
dwHeaderSize: u32,
dwObj: u32,
dwHow: u32,
};
const DIPROPCALPOV = extern struct {
diph: DIPROPHEADER,
lMin: [5]i32,
lMax: [5]i32,
};type
DIPROPHEADER {.bycopy.} = object
dwSize: uint32
dwHeaderSize: uint32
dwObj: uint32
dwHow: uint32
DIPROPCALPOV {.bycopy.} = object
diph: DIPROPHEADER
lMin: array[5, int32]
lMax: array[5, int32]struct DIPROPHEADER
{
uint dwSize;
uint dwHeaderSize;
uint dwObj;
uint dwHow;
}
struct DIPROPCALPOV
{
DIPROPHEADER diph;
int[5] lMin;
int[5] lMax;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DIPROPCALPOV サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; diph : DIPROPHEADER (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; lMin : INT (+16, 20byte) varptr(st)+16 を基点に操作(20byte:入れ子/配列)
; lMax : INT (+36, 20byte) varptr(st)+36 を基点に操作(20byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DIPROPHEADER
#field int dwSize
#field int dwHeaderSize
#field int dwObj
#field int dwHow
#endstruct
#defstruct global DIPROPCALPOV
#field DIPROPHEADER diph
#field int lMin 5
#field int lMax 5
#endstruct
stdim st, DIPROPCALPOV ; NSTRUCT 変数を確保