Win32 API 日本語リファレンス
ホームSystem.Power › CUSTOMIZED_IO_QUERY_INPUT_RETURN

CUSTOMIZED_IO_QUERY_INPUT_RETURN

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

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

フィールド

フィールドサイズx64x86説明
FunctionIdDWORD4+0+0問い合わせた入力機能の識別子である。
ErrorCodeDWORD4+4+4問い合わせ結果のエラーコードである。0で成功。
ValueDWORD4+8+8取得した入力値である。

各言語での定義

#include <windows.h>

// CUSTOMIZED_IO_QUERY_INPUT_RETURN  (x64 12 / x86 12 バイト)
typedef struct CUSTOMIZED_IO_QUERY_INPUT_RETURN {
    DWORD FunctionId;
    DWORD ErrorCode;
    DWORD Value;
} CUSTOMIZED_IO_QUERY_INPUT_RETURN;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CUSTOMIZED_IO_QUERY_INPUT_RETURN
{
    public uint FunctionId;
    public uint ErrorCode;
    public uint Value;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CUSTOMIZED_IO_QUERY_INPUT_RETURN
    Public FunctionId As UInteger
    Public ErrorCode As UInteger
    Public Value As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CUSTOMIZED_IO_QUERY_INPUT_RETURN(ctypes.Structure):
    _fields_ = [
        ("FunctionId", wintypes.DWORD),
        ("ErrorCode", wintypes.DWORD),
        ("Value", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CUSTOMIZED_IO_QUERY_INPUT_RETURN {
    pub FunctionId: u32,
    pub ErrorCode: u32,
    pub Value: u32,
}
import "golang.org/x/sys/windows"

type CUSTOMIZED_IO_QUERY_INPUT_RETURN struct {
	FunctionId uint32
	ErrorCode uint32
	Value uint32
}
type
  CUSTOMIZED_IO_QUERY_INPUT_RETURN = record
    FunctionId: DWORD;
    ErrorCode: DWORD;
    Value: DWORD;
  end;
const CUSTOMIZED_IO_QUERY_INPUT_RETURN = extern struct {
    FunctionId: u32,
    ErrorCode: u32,
    Value: u32,
};
type
  CUSTOMIZED_IO_QUERY_INPUT_RETURN {.bycopy.} = object
    FunctionId: uint32
    ErrorCode: uint32
    Value: uint32
struct CUSTOMIZED_IO_QUERY_INPUT_RETURN
{
    uint FunctionId;
    uint ErrorCode;
    uint Value;
}

HSP用 定義

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

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

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