ホーム › UI.WindowsAndMessaging › FRAME_MARGIN
FRAME_MARGIN
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| left | SHORT | 2 | +0 | +0 | 左端の余白(マージン)である。 |
| right | SHORT | 2 | +2 | +2 | 右端の余白(マージン)である。 |
| top | SHORT | 2 | +4 | +4 | 上端の余白(マージン)である。 |
| bottom | SHORT | 2 | +6 | +6 | 下端の余白(マージン)である。 |
各言語での定義
#include <windows.h>
// FRAME_MARGIN (x64 8 / x86 8 バイト)
typedef struct FRAME_MARGIN {
SHORT left;
SHORT right;
SHORT top;
SHORT bottom;
} FRAME_MARGIN;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FRAME_MARGIN
{
public short left;
public short right;
public short top;
public short bottom;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FRAME_MARGIN
Public left As Short
Public right As Short
Public top As Short
Public bottom As Short
End Structureimport ctypes
from ctypes import wintypes
class FRAME_MARGIN(ctypes.Structure):
_fields_ = [
("left", ctypes.c_short),
("right", ctypes.c_short),
("top", ctypes.c_short),
("bottom", ctypes.c_short),
]#[repr(C)]
pub struct FRAME_MARGIN {
pub left: i16,
pub right: i16,
pub top: i16,
pub bottom: i16,
}import "golang.org/x/sys/windows"
type FRAME_MARGIN struct {
left int16
right int16
top int16
bottom int16
}type
FRAME_MARGIN = record
left: Smallint;
right: Smallint;
top: Smallint;
bottom: Smallint;
end;const FRAME_MARGIN = extern struct {
left: i16,
right: i16,
top: i16,
bottom: i16,
};type
FRAME_MARGIN {.bycopy.} = object
left: int16
right: int16
top: int16
bottom: int16struct FRAME_MARGIN
{
short left;
short right;
short top;
short bottom;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FRAME_MARGIN サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; left : SHORT (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; right : SHORT (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; top : SHORT (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; bottom : SHORT (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FRAME_MARGIN
#field short left
#field short right
#field short top
#field short bottom
#endstruct
stdim st, FRAME_MARGIN ; NSTRUCT 変数を確保
st->left = 100
mes "left=" + st->left