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 | iContextType が HELPINFO_WINDOW の場合はウィンドウまたはコントロールの識別子、iContextType が HELPINFO_MENUITEM の場合はメニュー項目の識別子です。 |
| hItemHandle | HANDLE | 8/4 | +16 | +12 | iContextType が HELPINFO_WINDOW の場合は子ウィンドウまたはコントロールの識別子、iContextType が HELPINFO_MENUITEM の場合は関連付けられたメニューの識別子です。 |
| dwContextId | UINT_PTR | 8/4 | +24 | +16 | ウィンドウまたはコントロールのヘルプコンテキスト識別子です。 |
| MousePos | POINT | 8 | +32 | +20 | マウスカーソルのスクリーン座標を格納する POINT 構造体です。マウスカーソルの位置に基づいてヘルプを提供する場合に役立ちます。 |
公式ドキュメント
コンテキスト依存ヘルプが要求された項目に関する情報を格納します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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