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