HELPINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| iContextType | HELP_INFO_TYPE | 4 | +4 | +4 | ヘルプ対象の種類(ウィンドウ・コントロール等)。 |
| iCtrlId | INT | 4 | +8 | +8 | ヘルプ要求元コントロールの識別子。 |
| hItemHandle | HANDLE | 8/4 | +16 | +12 | ヘルプ要求元の項目またはウィンドウのハンドル。 |
| dwContextId | UINT_PTR | 8/4 | +24 | +16 | 関連付けられたヘルプコンテキストID。 |
| MousePos | POINT | 8 | +32 | +20 | ヘルプ要求時のマウス座標(POINT、画面座標)。 |
各言語での定義
#include <windows.h>
// POINT (x64 8 / x86 8 バイト)
typedef struct POINT {
INT x;
INT y;
} POINT;
// HELPINFO (x64 40 / x86 28 バイト)
typedef struct HELPINFO {
DWORD cbSize;
HELP_INFO_TYPE iContextType;
INT iCtrlId;
HANDLE hItemHandle;
UINT_PTR dwContextId;
POINT MousePos;
} HELPINFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HELPINFO
{
public uint cbSize;
public int iContextType;
public int iCtrlId;
public IntPtr hItemHandle;
public UIntPtr dwContextId;
public POINT MousePos;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
Public x As Integer
Public y As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HELPINFO
Public cbSize As UInteger
Public iContextType As Integer
Public iCtrlId As Integer
Public hItemHandle As IntPtr
Public dwContextId As UIntPtr
Public MousePos As POINT
End Structureimport ctypes
from ctypes import wintypes
class POINT(ctypes.Structure):
_fields_ = [
("x", ctypes.c_int),
("y", ctypes.c_int),
]
class HELPINFO(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("iContextType", ctypes.c_int),
("iCtrlId", ctypes.c_int),
("hItemHandle", ctypes.c_void_p),
("dwContextId", ctypes.c_size_t),
("MousePos", POINT),
]#[repr(C)]
pub struct POINT {
pub x: i32,
pub y: i32,
}
#[repr(C)]
pub struct HELPINFO {
pub cbSize: u32,
pub iContextType: i32,
pub iCtrlId: i32,
pub hItemHandle: *mut core::ffi::c_void,
pub dwContextId: usize,
pub MousePos: POINT,
}import "golang.org/x/sys/windows"
type POINT struct {
x int32
y int32
}
type HELPINFO struct {
cbSize uint32
iContextType int32
iCtrlId int32
hItemHandle uintptr
dwContextId uintptr
MousePos POINT
}type
POINT = record
x: Integer;
y: Integer;
end;
HELPINFO = record
cbSize: DWORD;
iContextType: Integer;
iCtrlId: Integer;
hItemHandle: Pointer;
dwContextId: NativeUInt;
MousePos: POINT;
end;const POINT = extern struct {
x: i32,
y: i32,
};
const HELPINFO = extern struct {
cbSize: u32,
iContextType: i32,
iCtrlId: i32,
hItemHandle: ?*anyopaque,
dwContextId: usize,
MousePos: POINT,
};type
POINT {.bycopy.} = object
x: int32
y: int32
HELPINFO {.bycopy.} = object
cbSize: uint32
iContextType: int32
iCtrlId: int32
hItemHandle: pointer
dwContextId: uint
MousePos: POINTstruct POINT
{
int x;
int y;
}
struct HELPINFO
{
uint cbSize;
int iContextType;
int iCtrlId;
void* hItemHandle;
size_t dwContextId;
POINT MousePos;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; HELPINFO サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; iContextType : HELP_INFO_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; iCtrlId : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hItemHandle : HANDLE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwContextId : UINT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; MousePos : POINT (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HELPINFO サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; iContextType : HELP_INFO_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; iCtrlId : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hItemHandle : HANDLE (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dwContextId : UINT_PTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; MousePos : POINT (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINT
#field int x
#field int y
#endstruct
#defstruct global HELPINFO
#field int cbSize
#field int iContextType
#field int iCtrlId
#field intptr hItemHandle
#field intptr dwContextId
#field POINT MousePos
#endstruct
stdim st, HELPINFO ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize