ホーム › Devices.HumanInterfaceDevice › DIENVELOPE
DIENVELOPE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| dwAttackLevel | DWORD | 4 | +4 | +4 | アタック開始時の力レベル。0〜10000の範囲。 |
| dwAttackTime | DWORD | 4 | +8 | +8 | アタック区間の継続時間をマイクロ秒単位で示す。 |
| dwFadeLevel | DWORD | 4 | +12 | +12 | フェード終了時の力レベル。0〜10000の範囲。 |
| dwFadeTime | DWORD | 4 | +16 | +16 | フェード区間の継続時間をマイクロ秒単位で示す。 |
各言語での定義
#include <windows.h>
// DIENVELOPE (x64 20 / x86 20 バイト)
typedef struct DIENVELOPE {
DWORD dwSize;
DWORD dwAttackLevel;
DWORD dwAttackTime;
DWORD dwFadeLevel;
DWORD dwFadeTime;
} DIENVELOPE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DIENVELOPE
{
public uint dwSize;
public uint dwAttackLevel;
public uint dwAttackTime;
public uint dwFadeLevel;
public uint dwFadeTime;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DIENVELOPE
Public dwSize As UInteger
Public dwAttackLevel As UInteger
Public dwAttackTime As UInteger
Public dwFadeLevel As UInteger
Public dwFadeTime As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DIENVELOPE(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwAttackLevel", wintypes.DWORD),
("dwAttackTime", wintypes.DWORD),
("dwFadeLevel", wintypes.DWORD),
("dwFadeTime", wintypes.DWORD),
]#[repr(C)]
pub struct DIENVELOPE {
pub dwSize: u32,
pub dwAttackLevel: u32,
pub dwAttackTime: u32,
pub dwFadeLevel: u32,
pub dwFadeTime: u32,
}import "golang.org/x/sys/windows"
type DIENVELOPE struct {
dwSize uint32
dwAttackLevel uint32
dwAttackTime uint32
dwFadeLevel uint32
dwFadeTime uint32
}type
DIENVELOPE = record
dwSize: DWORD;
dwAttackLevel: DWORD;
dwAttackTime: DWORD;
dwFadeLevel: DWORD;
dwFadeTime: DWORD;
end;const DIENVELOPE = extern struct {
dwSize: u32,
dwAttackLevel: u32,
dwAttackTime: u32,
dwFadeLevel: u32,
dwFadeTime: u32,
};type
DIENVELOPE {.bycopy.} = object
dwSize: uint32
dwAttackLevel: uint32
dwAttackTime: uint32
dwFadeLevel: uint32
dwFadeTime: uint32struct DIENVELOPE
{
uint dwSize;
uint dwAttackLevel;
uint dwAttackTime;
uint dwFadeLevel;
uint dwFadeTime;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DIENVELOPE サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwAttackLevel : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwAttackTime : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwFadeLevel : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFadeTime : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DIENVELOPE
#field int dwSize
#field int dwAttackLevel
#field int dwAttackTime
#field int dwFadeLevel
#field int dwFadeTime
#endstruct
stdim st, DIENVELOPE ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize