ホーム › UI.Controls.Dialogs › PRINTDLGEXW
PRINTDLGEXW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lStructSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。PrintDlgExW呼び出し前に設定する。 |
| hwndOwner | HWND | 8/4 | +4 | +4 | 印刷ダイアログを所有する親ウィンドウのハンドル。NULL不可。 |
| hDevMode | HGLOBAL | 8/4 | +12 | +8 | DEVMODE構造体を含むグローバルメモリのハンドル。入出力に使われる。 |
| hDevNames | HGLOBAL | 8/4 | +20 | +12 | DEVNAMES構造体を含むグローバルメモリのハンドル。プリンタ名等を保持する。 |
| hDC | HDC | 8/4 | +28 | +16 | 選択プリンタのデバイスコンテキストまたは情報コンテキストのハンドルを受け取る。 |
| Flags | PRINTDLGEX_FLAGS | 4 | +36 | +20 | ダイアログの初期化や動作を制御するPD_系フラグの組み合わせ。 |
| Flags2 | DWORD | 4 | +40 | +24 | 将来の拡張用の予約フィールド。0を指定する。 |
| ExclusionFlags | DWORD | 4 | +44 | +28 | 下部に表示する標準プロパティページを除外するフラグ。PD_EXCL_系を指定する。 |
| nPageRanges | DWORD | 4 | +48 | +32 | lpPageRangesに格納されたページ範囲の初期個数。 |
| nMaxPageRanges | DWORD | 4 | +52 | +36 | lpPageRangesバッファに格納可能なページ範囲の最大個数。 |
| lpPageRanges | PRINTPAGERANGE* | 8/4 | +56 | +40 | PRINTPAGERANGE配列へのポインタ。入出力で印刷範囲を保持する。 |
| nMinPage | DWORD | 4 | +64 | +44 | 指定可能な最小ページ番号。 |
| nMaxPage | DWORD | 4 | +68 | +48 | 指定可能な最大ページ番号。 |
| nCopies | DWORD | 4 | +72 | +52 | 印刷部数の初期値および結果値。 |
| hInstance | HINSTANCE | 8/4 | +76 | +56 | カスタムプロパティページのテンプレートを含むモジュールのハンドル。 |
| lpPrintTemplateName | LPWSTR | 8/4 | +84 | +60 | ダイアログ下部に置き換えるテンプレートのリソース名。 |
| lpCallback | IUnknown* | 8/4 | +92 | +64 | IPrintDialogCallbackまたはIObjectWithSiteを実装するコールバックオブジェクト。NULL可。 |
| nPropertyPages | DWORD | 4 | +100 | +68 | lphPropertyPagesに含まれる追加プロパティページの数。 |
| lphPropertyPages | HPROPSHEETPAGE* | 8/4 | +104 | +72 | 追加で表示するプロパティページのハンドル配列。 |
| nStartPage | DWORD | 4 | +112 | +76 | ダイアログ初期表示時に最前面にするページ。START_PAGE_GENERAL等を指定する。 |
| dwResultAction | DWORD | 4 | +116 | +80 | ダイアログ終了時のユーザー操作結果。PD_RESULT_PRINT等が返る。 |
各言語での定義
#include <windows.h>
// PRINTDLGEXW (x64 120 / x86 84 バイト)
#pragma pack(push, 1)
typedef struct PRINTDLGEXW {
DWORD lStructSize;
HWND hwndOwner;
HGLOBAL hDevMode;
HGLOBAL hDevNames;
HDC hDC;
PRINTDLGEX_FLAGS Flags;
DWORD Flags2;
DWORD ExclusionFlags;
DWORD nPageRanges;
DWORD nMaxPageRanges;
PRINTPAGERANGE* lpPageRanges;
DWORD nMinPage;
DWORD nMaxPage;
DWORD nCopies;
HINSTANCE hInstance;
LPWSTR lpPrintTemplateName;
IUnknown* lpCallback;
DWORD nPropertyPages;
HPROPSHEETPAGE* lphPropertyPages;
DWORD nStartPage;
DWORD dwResultAction;
} PRINTDLGEXW;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct PRINTDLGEXW
{
public uint lStructSize;
public IntPtr hwndOwner;
public IntPtr hDevMode;
public IntPtr hDevNames;
public IntPtr hDC;
public uint Flags;
public uint Flags2;
public uint ExclusionFlags;
public uint nPageRanges;
public uint nMaxPageRanges;
public IntPtr lpPageRanges;
public uint nMinPage;
public uint nMaxPage;
public uint nCopies;
public IntPtr hInstance;
public IntPtr lpPrintTemplateName;
public IntPtr lpCallback;
public uint nPropertyPages;
public IntPtr lphPropertyPages;
public uint nStartPage;
public uint dwResultAction;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure PRINTDLGEXW
Public lStructSize As UInteger
Public hwndOwner As IntPtr
Public hDevMode As IntPtr
Public hDevNames As IntPtr
Public hDC As IntPtr
Public Flags As UInteger
Public Flags2 As UInteger
Public ExclusionFlags As UInteger
Public nPageRanges As UInteger
Public nMaxPageRanges As UInteger
Public lpPageRanges As IntPtr
Public nMinPage As UInteger
Public nMaxPage As UInteger
Public nCopies As UInteger
Public hInstance As IntPtr
Public lpPrintTemplateName As IntPtr
Public lpCallback As IntPtr
Public nPropertyPages As UInteger
Public lphPropertyPages As IntPtr
Public nStartPage As UInteger
Public dwResultAction As UInteger
End Structureimport ctypes
from ctypes import wintypes
class PRINTDLGEXW(ctypes.Structure):
_pack_ = 1
_fields_ = [
("lStructSize", wintypes.DWORD),
("hwndOwner", ctypes.c_void_p),
("hDevMode", ctypes.c_void_p),
("hDevNames", ctypes.c_void_p),
("hDC", ctypes.c_void_p),
("Flags", wintypes.DWORD),
("Flags2", wintypes.DWORD),
("ExclusionFlags", wintypes.DWORD),
("nPageRanges", wintypes.DWORD),
("nMaxPageRanges", wintypes.DWORD),
("lpPageRanges", ctypes.c_void_p),
("nMinPage", wintypes.DWORD),
("nMaxPage", wintypes.DWORD),
("nCopies", wintypes.DWORD),
("hInstance", ctypes.c_void_p),
("lpPrintTemplateName", ctypes.c_void_p),
("lpCallback", ctypes.c_void_p),
("nPropertyPages", wintypes.DWORD),
("lphPropertyPages", ctypes.c_void_p),
("nStartPage", wintypes.DWORD),
("dwResultAction", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct PRINTDLGEXW {
pub lStructSize: u32,
pub hwndOwner: *mut core::ffi::c_void,
pub hDevMode: *mut core::ffi::c_void,
pub hDevNames: *mut core::ffi::c_void,
pub hDC: *mut core::ffi::c_void,
pub Flags: u32,
pub Flags2: u32,
pub ExclusionFlags: u32,
pub nPageRanges: u32,
pub nMaxPageRanges: u32,
pub lpPageRanges: *mut core::ffi::c_void,
pub nMinPage: u32,
pub nMaxPage: u32,
pub nCopies: u32,
pub hInstance: *mut core::ffi::c_void,
pub lpPrintTemplateName: *mut core::ffi::c_void,
pub lpCallback: *mut core::ffi::c_void,
pub nPropertyPages: u32,
pub lphPropertyPages: *mut core::ffi::c_void,
pub nStartPage: u32,
pub dwResultAction: u32,
}import "golang.org/x/sys/windows"
type PRINTDLGEXW struct {
lStructSize uint32
hwndOwner uintptr
hDevMode uintptr
hDevNames uintptr
hDC uintptr
Flags uint32
Flags2 uint32
ExclusionFlags uint32
nPageRanges uint32
nMaxPageRanges uint32
lpPageRanges uintptr
nMinPage uint32
nMaxPage uint32
nCopies uint32
hInstance uintptr
lpPrintTemplateName uintptr
lpCallback uintptr
nPropertyPages uint32
lphPropertyPages uintptr
nStartPage uint32
dwResultAction uint32
}type
PRINTDLGEXW = packed record
lStructSize: DWORD;
hwndOwner: Pointer;
hDevMode: Pointer;
hDevNames: Pointer;
hDC: Pointer;
Flags: DWORD;
Flags2: DWORD;
ExclusionFlags: DWORD;
nPageRanges: DWORD;
nMaxPageRanges: DWORD;
lpPageRanges: Pointer;
nMinPage: DWORD;
nMaxPage: DWORD;
nCopies: DWORD;
hInstance: Pointer;
lpPrintTemplateName: Pointer;
lpCallback: Pointer;
nPropertyPages: DWORD;
lphPropertyPages: Pointer;
nStartPage: DWORD;
dwResultAction: DWORD;
end;const PRINTDLGEXW = extern struct {
lStructSize: u32,
hwndOwner: ?*anyopaque,
hDevMode: ?*anyopaque,
hDevNames: ?*anyopaque,
hDC: ?*anyopaque,
Flags: u32,
Flags2: u32,
ExclusionFlags: u32,
nPageRanges: u32,
nMaxPageRanges: u32,
lpPageRanges: ?*anyopaque,
nMinPage: u32,
nMaxPage: u32,
nCopies: u32,
hInstance: ?*anyopaque,
lpPrintTemplateName: ?*anyopaque,
lpCallback: ?*anyopaque,
nPropertyPages: u32,
lphPropertyPages: ?*anyopaque,
nStartPage: u32,
dwResultAction: u32,
};type
PRINTDLGEXW {.packed.} = object
lStructSize: uint32
hwndOwner: pointer
hDevMode: pointer
hDevNames: pointer
hDC: pointer
Flags: uint32
Flags2: uint32
ExclusionFlags: uint32
nPageRanges: uint32
nMaxPageRanges: uint32
lpPageRanges: pointer
nMinPage: uint32
nMaxPage: uint32
nCopies: uint32
hInstance: pointer
lpPrintTemplateName: pointer
lpCallback: pointer
nPropertyPages: uint32
lphPropertyPages: pointer
nStartPage: uint32
dwResultAction: uint32align(1)
struct PRINTDLGEXW
{
uint lStructSize;
void* hwndOwner;
void* hDevMode;
void* hDevNames;
void* hDC;
uint Flags;
uint Flags2;
uint ExclusionFlags;
uint nPageRanges;
uint nMaxPageRanges;
void* lpPageRanges;
uint nMinPage;
uint nMaxPage;
uint nCopies;
void* hInstance;
void* lpPrintTemplateName;
void* lpCallback;
uint nPropertyPages;
void* lphPropertyPages;
uint nStartPage;
uint dwResultAction;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; PRINTDLGEXW サイズ: 84 バイト(x86)
dim st, 21 ; 4byte整数×21(構造体サイズ 84 / 4 切り上げ)
; lStructSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hwndOwner : HWND (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hDevMode : HGLOBAL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hDevNames : HGLOBAL (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; hDC : HDC (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Flags : PRINTDLGEX_FLAGS (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Flags2 : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ExclusionFlags : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; nPageRanges : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; nMaxPageRanges : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; lpPageRanges : PRINTPAGERANGE* (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; nMinPage : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; nMaxPage : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; nCopies : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; hInstance : HINSTANCE (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; lpPrintTemplateName : LPWSTR (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; lpCallback : IUnknown* (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; nPropertyPages : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; lphPropertyPages : HPROPSHEETPAGE* (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; nStartPage : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; dwResultAction : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PRINTDLGEXW サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; lStructSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hwndOwner : HWND (+4, 8byte) qpoke st,4,値 / qpeek(st,4) ※IronHSPのみ。3.7/3.8は lpoke st,4,下位 : lpoke st,8,上位
; hDevMode : HGLOBAL (+12, 8byte) qpoke st,12,値 / qpeek(st,12) ※IronHSPのみ。3.7/3.8は lpoke st,12,下位 : lpoke st,16,上位
; hDevNames : HGLOBAL (+20, 8byte) qpoke st,20,値 / qpeek(st,20) ※IronHSPのみ。3.7/3.8は lpoke st,20,下位 : lpoke st,24,上位
; hDC : HDC (+28, 8byte) qpoke st,28,値 / qpeek(st,28) ※IronHSPのみ。3.7/3.8は lpoke st,28,下位 : lpoke st,32,上位
; Flags : PRINTDLGEX_FLAGS (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; Flags2 : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ExclusionFlags : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; nPageRanges : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; nMaxPageRanges : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; lpPageRanges : PRINTPAGERANGE* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; nMinPage : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; nMaxPage : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; nCopies : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; hInstance : HINSTANCE (+76, 8byte) qpoke st,76,値 / qpeek(st,76) ※IronHSPのみ。3.7/3.8は lpoke st,76,下位 : lpoke st,80,上位
; lpPrintTemplateName : LPWSTR (+84, 8byte) qpoke st,84,値 / qpeek(st,84) ※IronHSPのみ。3.7/3.8は lpoke st,84,下位 : lpoke st,88,上位
; lpCallback : IUnknown* (+92, 8byte) qpoke st,92,値 / qpeek(st,92) ※IronHSPのみ。3.7/3.8は lpoke st,92,下位 : lpoke st,96,上位
; nPropertyPages : DWORD (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; lphPropertyPages : HPROPSHEETPAGE* (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; nStartPage : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; dwResultAction : DWORD (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PRINTDLGEXW, pack=1
#field int lStructSize
#field intptr hwndOwner
#field intptr hDevMode
#field intptr hDevNames
#field intptr hDC
#field int Flags
#field int Flags2
#field int ExclusionFlags
#field int nPageRanges
#field int nMaxPageRanges
#field intptr lpPageRanges
#field int nMinPage
#field int nMaxPage
#field int nCopies
#field intptr hInstance
#field intptr lpPrintTemplateName
#field intptr lpCallback
#field int nPropertyPages
#field intptr lphPropertyPages
#field int nStartPage
#field int dwResultAction
#endstruct
stdim st, PRINTDLGEXW ; NSTRUCT 変数を確保
st->lStructSize = 100
mes "lStructSize=" + st->lStructSize