HELPWININFOW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| wStructSize | INT | 4 | +0 | +0 | この構造体のバイトサイズ(Unicode版)。 |
| x | INT | 4 | +4 | +4 | ヘルプウィンドウの左上X座標。 |
| y | INT | 4 | +8 | +8 | ヘルプウィンドウの左上Y座標。 |
| dx | INT | 4 | +12 | +12 | ヘルプウィンドウの幅。 |
| dy | INT | 4 | +16 | +16 | ヘルプウィンドウの高さ。 |
| wMax | INT | 4 | +20 | +20 | ウィンドウの初期表示状態(最大化等)。 |
| rgchMember | WCHAR | 4 | +24 | +24 | ウィンドウタイプ名の文字列(Unicode、固定長配列)。 |
各言語での定義
#include <windows.h>
// HELPWININFOW (x64 28 / x86 28 バイト)
typedef struct HELPWININFOW {
INT wStructSize;
INT x;
INT y;
INT dx;
INT dy;
INT wMax;
WCHAR rgchMember[2];
} HELPWININFOW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HELPWININFOW
{
public int wStructSize;
public int x;
public int y;
public int dx;
public int dy;
public int wMax;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)] public string rgchMember;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HELPWININFOW
Public wStructSize As Integer
Public x As Integer
Public y As Integer
Public dx As Integer
Public dy As Integer
Public wMax As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=2)> Public rgchMember As String
End Structureimport ctypes
from ctypes import wintypes
class HELPWININFOW(ctypes.Structure):
_fields_ = [
("wStructSize", ctypes.c_int),
("x", ctypes.c_int),
("y", ctypes.c_int),
("dx", ctypes.c_int),
("dy", ctypes.c_int),
("wMax", ctypes.c_int),
("rgchMember", ctypes.c_wchar * 2),
]#[repr(C)]
pub struct HELPWININFOW {
pub wStructSize: i32,
pub x: i32,
pub y: i32,
pub dx: i32,
pub dy: i32,
pub wMax: i32,
pub rgchMember: [u16; 2],
}import "golang.org/x/sys/windows"
type HELPWININFOW struct {
wStructSize int32
x int32
y int32
dx int32
dy int32
wMax int32
rgchMember [2]uint16
}type
HELPWININFOW = record
wStructSize: Integer;
x: Integer;
y: Integer;
dx: Integer;
dy: Integer;
wMax: Integer;
rgchMember: array[0..1] of WideChar;
end;const HELPWININFOW = extern struct {
wStructSize: i32,
x: i32,
y: i32,
dx: i32,
dy: i32,
wMax: i32,
rgchMember: [2]u16,
};type
HELPWININFOW {.bycopy.} = object
wStructSize: int32
x: int32
y: int32
dx: int32
dy: int32
wMax: int32
rgchMember: array[2, uint16]struct HELPWININFOW
{
int wStructSize;
int x;
int y;
int dx;
int dy;
int wMax;
wchar[2] rgchMember;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HELPWININFOW サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; wStructSize : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; x : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; y : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dx : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dy : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; wMax : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; rgchMember : WCHAR (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HELPWININFOW
#field int wStructSize
#field int x
#field int y
#field int dx
#field int dy
#field int wMax
#field wchar rgchMember 2
#endstruct
stdim st, HELPWININFOW ; NSTRUCT 変数を確保
st->wStructSize = 100
mes "wStructSize=" + st->wStructSize