Win32 API 日本語リファレンス
ホームGraphics.Printing › SHOWUIPARAMS

SHOWUIPARAMS

構造体
サイズx64: 48 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
UITypeUI_TYPE4+0+0表示するUIの種類を示す列挙値(UI_TYPE)。
MessageBoxParamsMESSAGEBOX_PARAMS40/24+8+4メッセージボックス用のパラメーターを保持するMESSAGEBOX_PARAMS。

各言語での定義

#include <windows.h>

// MESSAGEBOX_PARAMS  (x64 40 / x86 24 バイト)
typedef struct MESSAGEBOX_PARAMS {
    DWORD cbSize;
    LPWSTR pTitle;
    LPWSTR pMessage;
    DWORD Style;
    DWORD dwTimeout;
    BOOL bWait;
} MESSAGEBOX_PARAMS;

// SHOWUIPARAMS  (x64 48 / x86 28 バイト)
typedef struct SHOWUIPARAMS {
    UI_TYPE UIType;
    MESSAGEBOX_PARAMS MessageBoxParams;
} SHOWUIPARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MESSAGEBOX_PARAMS
{
    public uint cbSize;
    public IntPtr pTitle;
    public IntPtr pMessage;
    public uint Style;
    public uint dwTimeout;
    [MarshalAs(UnmanagedType.Bool)] public bool bWait;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SHOWUIPARAMS
{
    public int UIType;
    public MESSAGEBOX_PARAMS MessageBoxParams;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MESSAGEBOX_PARAMS
    Public cbSize As UInteger
    Public pTitle As IntPtr
    Public pMessage As IntPtr
    Public Style As UInteger
    Public dwTimeout As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public bWait As Boolean
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SHOWUIPARAMS
    Public UIType As Integer
    Public MessageBoxParams As MESSAGEBOX_PARAMS
End Structure
import ctypes
from ctypes import wintypes

class MESSAGEBOX_PARAMS(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("pTitle", ctypes.c_void_p),
        ("pMessage", ctypes.c_void_p),
        ("Style", wintypes.DWORD),
        ("dwTimeout", wintypes.DWORD),
        ("bWait", wintypes.BOOL),
    ]

class SHOWUIPARAMS(ctypes.Structure):
    _fields_ = [
        ("UIType", ctypes.c_int),
        ("MessageBoxParams", MESSAGEBOX_PARAMS),
    ]
#[repr(C)]
pub struct MESSAGEBOX_PARAMS {
    pub cbSize: u32,
    pub pTitle: *mut core::ffi::c_void,
    pub pMessage: *mut core::ffi::c_void,
    pub Style: u32,
    pub dwTimeout: u32,
    pub bWait: i32,
}

#[repr(C)]
pub struct SHOWUIPARAMS {
    pub UIType: i32,
    pub MessageBoxParams: MESSAGEBOX_PARAMS,
}
import "golang.org/x/sys/windows"

type MESSAGEBOX_PARAMS struct {
	cbSize uint32
	pTitle uintptr
	pMessage uintptr
	Style uint32
	dwTimeout uint32
	bWait int32
}

type SHOWUIPARAMS struct {
	UIType int32
	MessageBoxParams MESSAGEBOX_PARAMS
}
type
  MESSAGEBOX_PARAMS = record
    cbSize: DWORD;
    pTitle: Pointer;
    pMessage: Pointer;
    Style: DWORD;
    dwTimeout: DWORD;
    bWait: BOOL;
  end;

  SHOWUIPARAMS = record
    UIType: Integer;
    MessageBoxParams: MESSAGEBOX_PARAMS;
  end;
const MESSAGEBOX_PARAMS = extern struct {
    cbSize: u32,
    pTitle: ?*anyopaque,
    pMessage: ?*anyopaque,
    Style: u32,
    dwTimeout: u32,
    bWait: i32,
};

const SHOWUIPARAMS = extern struct {
    UIType: i32,
    MessageBoxParams: MESSAGEBOX_PARAMS,
};
type
  MESSAGEBOX_PARAMS {.bycopy.} = object
    cbSize: uint32
    pTitle: pointer
    pMessage: pointer
    Style: uint32
    dwTimeout: uint32
    bWait: int32

  SHOWUIPARAMS {.bycopy.} = object
    UIType: int32
    MessageBoxParams: MESSAGEBOX_PARAMS
struct MESSAGEBOX_PARAMS
{
    uint cbSize;
    void* pTitle;
    void* pMessage;
    uint Style;
    uint dwTimeout;
    int bWait;
}

struct SHOWUIPARAMS
{
    int UIType;
    MESSAGEBOX_PARAMS MessageBoxParams;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SHOWUIPARAMS サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; UIType : UI_TYPE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MessageBoxParams : MESSAGEBOX_PARAMS (+4, 24byte)  varptr(st)+4 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SHOWUIPARAMS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; UIType : UI_TYPE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MessageBoxParams : MESSAGEBOX_PARAMS (+8, 40byte)  varptr(st)+8 を基点に操作(40byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global MESSAGEBOX_PARAMS
    #field int cbSize
    #field intptr pTitle
    #field intptr pMessage
    #field int Style
    #field int dwTimeout
    #field bool bWait
#endstruct

#defstruct global SHOWUIPARAMS
    #field int UIType
    #field MESSAGEBOX_PARAMS MessageBoxParams
#endstruct

stdim st, SHOWUIPARAMS        ; NSTRUCT 変数を確保
st->UIType = 100
mes "UIType=" + st->UIType