Win32 API 日本語リファレンス
ホームUI.WindowsAndMessaging › MDICREATESTRUCTA

MDICREATESTRUCTA

構造体
サイズx64: 56 バイト / x86: 36 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
szClassLPSTR8/4+0+0MDI 子ウィンドウのクラス名(ANSI 文字列)へのポインタである。
szTitleLPSTR8/4+8+4MDI 子ウィンドウのタイトル(ANSI 文字列)へのポインタである。
hOwnerHANDLE8/4+16+8子ウィンドウを作成するインスタンスのハンドルである。
xINT4+24+12子ウィンドウの左端の x 座標である。
yINT4+28+16子ウィンドウの上端の y 座標である。
cxINT4+32+20子ウィンドウの幅である。
cyINT4+36+24子ウィンドウの高さである。
styleWINDOW_STYLE4+40+28MDI 子ウィンドウのスタイルである。
lParamLPARAM8/4+48+32アプリケーション定義の追加データである。

各言語での定義

#include <windows.h>

// MDICREATESTRUCTA  (x64 56 / x86 36 バイト)
typedef struct MDICREATESTRUCTA {
    LPSTR szClass;
    LPSTR szTitle;
    HANDLE hOwner;
    INT x;
    INT y;
    INT cx;
    INT cy;
    WINDOW_STYLE style;
    LPARAM lParam;
} MDICREATESTRUCTA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MDICREATESTRUCTA
{
    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 MDICREATESTRUCTA
    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 Structure
import ctypes
from ctypes import wintypes

class MDICREATESTRUCTA(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 MDICREATESTRUCTA {
    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 MDICREATESTRUCTA struct {
	szClass uintptr
	szTitle uintptr
	hOwner uintptr
	x int32
	y int32
	cx int32
	cy int32
	style uint32
	lParam uintptr
}
type
  MDICREATESTRUCTA = record
    szClass: Pointer;
    szTitle: Pointer;
    hOwner: Pointer;
    x: Integer;
    y: Integer;
    cx: Integer;
    cy: Integer;
    style: DWORD;
    lParam: NativeInt;
  end;
const MDICREATESTRUCTA = extern struct {
    szClass: ?*anyopaque,
    szTitle: ?*anyopaque,
    hOwner: ?*anyopaque,
    x: i32,
    y: i32,
    cx: i32,
    cy: i32,
    style: u32,
    lParam: isize,
};
type
  MDICREATESTRUCTA {.bycopy.} = object
    szClass: pointer
    szTitle: pointer
    hOwner: pointer
    x: int32
    y: int32
    cx: int32
    cy: int32
    style: uint32
    lParam: int
struct MDICREATESTRUCTA
{
    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 レイアウト)
; MDICREATESTRUCTA サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; szClass : LPSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; szTitle : LPSTR (+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 レイアウト)
; MDICREATESTRUCTA サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; szClass : LPSTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; szTitle : LPSTR (+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 MDICREATESTRUCTA
    #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, MDICREATESTRUCTA        ; NSTRUCT 変数を確保
st->x = 100
mes "x=" + st->x