ホーム › System.RemoteDesktop › WTS_SMALL_RECT
WTS_SMALL_RECT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Left | SHORT | 2 | +0 | +0 | 矩形の左端の座標。 |
| Top | SHORT | 2 | +2 | +2 | 矩形の上端の座標。 |
| Right | SHORT | 2 | +4 | +4 | 矩形の右端の座標。 |
| Bottom | SHORT | 2 | +6 | +6 | 矩形の下端の座標。 |
各言語での定義
#include <windows.h>
// WTS_SMALL_RECT (x64 8 / x86 8 バイト)
typedef struct WTS_SMALL_RECT {
SHORT Left;
SHORT Top;
SHORT Right;
SHORT Bottom;
} WTS_SMALL_RECT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTS_SMALL_RECT
{
public short Left;
public short Top;
public short Right;
public short Bottom;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTS_SMALL_RECT
Public Left As Short
Public Top As Short
Public Right As Short
Public Bottom As Short
End Structureimport ctypes
from ctypes import wintypes
class WTS_SMALL_RECT(ctypes.Structure):
_fields_ = [
("Left", ctypes.c_short),
("Top", ctypes.c_short),
("Right", ctypes.c_short),
("Bottom", ctypes.c_short),
]#[repr(C)]
pub struct WTS_SMALL_RECT {
pub Left: i16,
pub Top: i16,
pub Right: i16,
pub Bottom: i16,
}import "golang.org/x/sys/windows"
type WTS_SMALL_RECT struct {
Left int16
Top int16
Right int16
Bottom int16
}type
WTS_SMALL_RECT = record
Left: Smallint;
Top: Smallint;
Right: Smallint;
Bottom: Smallint;
end;const WTS_SMALL_RECT = extern struct {
Left: i16,
Top: i16,
Right: i16,
Bottom: i16,
};type
WTS_SMALL_RECT {.bycopy.} = object
Left: int16
Top: int16
Right: int16
Bottom: int16struct WTS_SMALL_RECT
{
short Left;
short Top;
short Right;
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 レイアウト)
; WTS_SMALL_RECT サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; Left : SHORT (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Top : SHORT (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; Right : 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 WTS_SMALL_RECT
#field short Left
#field short Top
#field short Right
#field short Bottom
#endstruct
stdim st, WTS_SMALL_RECT ; NSTRUCT 変数を確保
st->Left = 100
mes "Left=" + st->Left