ホーム › UI.WindowsAndMessaging › MINIMIZEDMETRICS
MINIMIZEDMETRICS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズ(バイト数)である。 |
| iWidth | INT | 4 | +4 | +4 | 最小化ウィンドウの幅(ピクセル)である。 |
| iHorzGap | INT | 4 | +8 | +8 | 最小化ウィンドウ間の水平方向の間隔(ピクセル)である。 |
| iVertGap | INT | 4 | +12 | +12 | 最小化ウィンドウ間の垂直方向の間隔(ピクセル)である。 |
| iArrange | MINIMIZEDMETRICS_ARRANGE | 4 | +16 | +16 | 最小化ウィンドウの配置開始位置と方向を示す値である。 |
各言語での定義
#include <windows.h>
// MINIMIZEDMETRICS (x64 20 / x86 20 バイト)
typedef struct MINIMIZEDMETRICS {
DWORD cbSize;
INT iWidth;
INT iHorzGap;
INT iVertGap;
MINIMIZEDMETRICS_ARRANGE iArrange;
} MINIMIZEDMETRICS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MINIMIZEDMETRICS
{
public uint cbSize;
public int iWidth;
public int iHorzGap;
public int iVertGap;
public int iArrange;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MINIMIZEDMETRICS
Public cbSize As UInteger
Public iWidth As Integer
Public iHorzGap As Integer
Public iVertGap As Integer
Public iArrange As Integer
End Structureimport ctypes
from ctypes import wintypes
class MINIMIZEDMETRICS(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("iWidth", ctypes.c_int),
("iHorzGap", ctypes.c_int),
("iVertGap", ctypes.c_int),
("iArrange", ctypes.c_int),
]#[repr(C)]
pub struct MINIMIZEDMETRICS {
pub cbSize: u32,
pub iWidth: i32,
pub iHorzGap: i32,
pub iVertGap: i32,
pub iArrange: i32,
}import "golang.org/x/sys/windows"
type MINIMIZEDMETRICS struct {
cbSize uint32
iWidth int32
iHorzGap int32
iVertGap int32
iArrange int32
}type
MINIMIZEDMETRICS = record
cbSize: DWORD;
iWidth: Integer;
iHorzGap: Integer;
iVertGap: Integer;
iArrange: Integer;
end;const MINIMIZEDMETRICS = extern struct {
cbSize: u32,
iWidth: i32,
iHorzGap: i32,
iVertGap: i32,
iArrange: i32,
};type
MINIMIZEDMETRICS {.bycopy.} = object
cbSize: uint32
iWidth: int32
iHorzGap: int32
iVertGap: int32
iArrange: int32struct MINIMIZEDMETRICS
{
uint cbSize;
int iWidth;
int iHorzGap;
int iVertGap;
int iArrange;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MINIMIZEDMETRICS サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; iWidth : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; iHorzGap : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; iVertGap : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; iArrange : MINIMIZEDMETRICS_ARRANGE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MINIMIZEDMETRICS
#field int cbSize
#field int iWidth
#field int iHorzGap
#field int iVertGap
#field int iArrange
#endstruct
stdim st, MINIMIZEDMETRICS ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize