ホーム › UI.WindowsAndMessaging › MDICREATESTRUCTW
MDICREATESTRUCTW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| szClass | LPWSTR | 8/4 | +0 | +0 | MDI 子ウィンドウのクラス名(Unicode 文字列)へのポインタである。 |
| szTitle | LPWSTR | 8/4 | +8 | +4 | MDI 子ウィンドウのタイトル(Unicode 文字列)へのポインタである。 |
| hOwner | HANDLE | 8/4 | +16 | +8 | 子ウィンドウを作成するインスタンスのハンドルである。 |
| x | INT | 4 | +24 | +12 | 子ウィンドウの左端の x 座標である。 |
| y | INT | 4 | +28 | +16 | 子ウィンドウの上端の y 座標である。 |
| cx | INT | 4 | +32 | +20 | 子ウィンドウの幅である。 |
| cy | INT | 4 | +36 | +24 | 子ウィンドウの高さである。 |
| style | WINDOW_STYLE | 4 | +40 | +28 | MDI 子ウィンドウのスタイルである。 |
| lParam | LPARAM | 8/4 | +48 | +32 | アプリケーション定義の追加データである。 |
各言語での定義
#include <windows.h>
// MDICREATESTRUCTW (x64 56 / x86 36 バイト)
typedef struct MDICREATESTRUCTW {
LPWSTR szClass;
LPWSTR szTitle;
HANDLE hOwner;
INT x;
INT y;
INT cx;
INT cy;
WINDOW_STYLE style;
LPARAM lParam;
} MDICREATESTRUCTW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MDICREATESTRUCTW
{
public IntPtr szClass;
public IntPtr szTitle;
public IntPtr hOwner;
public int x;
public int y;
public int cx;
public int cy;
public uint style;
public IntPtr lParam;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MDICREATESTRUCTW
Public szClass As IntPtr
Public szTitle As IntPtr
Public hOwner As IntPtr
Public x As Integer
Public y As Integer
Public cx As Integer
Public cy As Integer
Public style As UInteger
Public lParam As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MDICREATESTRUCTW(ctypes.Structure):
_fields_ = [
("szClass", ctypes.c_void_p),
("szTitle", ctypes.c_void_p),
("hOwner", ctypes.c_void_p),
("x", ctypes.c_int),
("y", ctypes.c_int),
("cx", ctypes.c_int),
("cy", ctypes.c_int),
("style", wintypes.DWORD),
("lParam", ctypes.c_ssize_t),
]#[repr(C)]
pub struct MDICREATESTRUCTW {
pub szClass: *mut core::ffi::c_void,
pub szTitle: *mut core::ffi::c_void,
pub hOwner: *mut core::ffi::c_void,
pub x: i32,
pub y: i32,
pub cx: i32,
pub cy: i32,
pub style: u32,
pub lParam: isize,
}import "golang.org/x/sys/windows"
type MDICREATESTRUCTW struct {
szClass uintptr
szTitle uintptr
hOwner uintptr
x int32
y int32
cx int32
cy int32
style uint32
lParam uintptr
}type
MDICREATESTRUCTW = record
szClass: Pointer;
szTitle: Pointer;
hOwner: Pointer;
x: Integer;
y: Integer;
cx: Integer;
cy: Integer;
style: DWORD;
lParam: NativeInt;
end;const MDICREATESTRUCTW = extern struct {
szClass: ?*anyopaque,
szTitle: ?*anyopaque,
hOwner: ?*anyopaque,
x: i32,
y: i32,
cx: i32,
cy: i32,
style: u32,
lParam: isize,
};type
MDICREATESTRUCTW {.bycopy.} = object
szClass: pointer
szTitle: pointer
hOwner: pointer
x: int32
y: int32
cx: int32
cy: int32
style: uint32
lParam: intstruct MDICREATESTRUCTW
{
void* szClass;
void* szTitle;
void* hOwner;
int x;
int y;
int cx;
int cy;
uint style;
ptrdiff_t lParam;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MDICREATESTRUCTW サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; szClass : LPWSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; szTitle : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hOwner : HANDLE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; x : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; y : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; cx : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; cy : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; style : WINDOW_STYLE (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; lParam : LPARAM (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MDICREATESTRUCTW サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; szClass : LPWSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; szTitle : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hOwner : HANDLE (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; x : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; y : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; cx : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; cy : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; style : WINDOW_STYLE (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; lParam : LPARAM (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MDICREATESTRUCTW
#field intptr szClass
#field intptr szTitle
#field intptr hOwner
#field int x
#field int y
#field int cx
#field int cy
#field int style
#field intptr lParam
#endstruct
stdim st, MDICREATESTRUCTW ; NSTRUCT 変数を確保
st->x = 100
mes "x=" + st->x