ホーム › Graphics.Printing › OEMCUIPPARAM
OEMCUIPPARAM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| poemuiobj | OEMUIOBJ* | 8/4 | +8 | +4 | OEM UIコールバックオブジェクトへのポインター。 |
| hPrinter | HANDLE | 8/4 | +16 | +8 | 対象プリンターのハンドル。 |
| pPrinterName | LPWSTR | 8/4 | +24 | +12 | 対象プリンター名を指すUnicode文字列。 |
| hModule | HANDLE | 8/4 | +32 | +16 | OEM UIプラグインモジュールのハンドル。 |
| hOEMHeap | HANDLE | 8/4 | +40 | +20 | OEMが使用するヒープのハンドル。 |
| pPublicDM | DEVMODEA* | 8/4 | +48 | +24 | パブリックDEVMODE構造体へのポインター。 |
| pOEMDM | void* | 8/4 | +56 | +28 | OEMプライベートDEVMODEへのポインター。 |
| dwFlags | DWORD | 4 | +64 | +32 | UI処理の動作を制御するフラグ。 |
| pDrvOptItems | OPTITEM* | 8/4 | +72 | +36 | ドライバーのオプション項目配列へのポインター(OPTITEM)。 |
| cDrvOptItems | DWORD | 4 | +80 | +40 | pDrvOptItems配列の要素数。 |
| pOEMOptItems | OPTITEM* | 8/4 | +88 | +44 | OEMのオプション項目配列へのポインター(OPTITEM)。 |
| cOEMOptItems | DWORD | 4 | +96 | +48 | pOEMOptItems配列の要素数。 |
| pOEMUserData | void* | 8/4 | +104 | +52 | OEM固有のユーザーデータへのポインター。 |
| OEMCUIPCallback | OEMCUIPCALLBACK | 8/4 | +112 | +56 | 共通UIプロパティページ用のOEMコールバック関数。 |
各言語での定義
#include <windows.h>
// OEMCUIPPARAM (x64 120 / x86 60 バイト)
typedef struct OEMCUIPPARAM {
DWORD cbSize;
OEMUIOBJ* poemuiobj;
HANDLE hPrinter;
LPWSTR pPrinterName;
HANDLE hModule;
HANDLE hOEMHeap;
DEVMODEA* pPublicDM;
void* pOEMDM;
DWORD dwFlags;
OPTITEM* pDrvOptItems;
DWORD cDrvOptItems;
OPTITEM* pOEMOptItems;
DWORD cOEMOptItems;
void* pOEMUserData;
OEMCUIPCALLBACK OEMCUIPCallback;
} OEMCUIPPARAM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OEMCUIPPARAM
{
public uint cbSize;
public IntPtr poemuiobj;
public IntPtr hPrinter;
public IntPtr pPrinterName;
public IntPtr hModule;
public IntPtr hOEMHeap;
public IntPtr pPublicDM;
public IntPtr pOEMDM;
public uint dwFlags;
public IntPtr pDrvOptItems;
public uint cDrvOptItems;
public IntPtr pOEMOptItems;
public uint cOEMOptItems;
public IntPtr pOEMUserData;
public IntPtr OEMCUIPCallback;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OEMCUIPPARAM
Public cbSize As UInteger
Public poemuiobj As IntPtr
Public hPrinter As IntPtr
Public pPrinterName As IntPtr
Public hModule As IntPtr
Public hOEMHeap As IntPtr
Public pPublicDM As IntPtr
Public pOEMDM As IntPtr
Public dwFlags As UInteger
Public pDrvOptItems As IntPtr
Public cDrvOptItems As UInteger
Public pOEMOptItems As IntPtr
Public cOEMOptItems As UInteger
Public pOEMUserData As IntPtr
Public OEMCUIPCallback As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class OEMCUIPPARAM(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("poemuiobj", ctypes.c_void_p),
("hPrinter", ctypes.c_void_p),
("pPrinterName", ctypes.c_void_p),
("hModule", ctypes.c_void_p),
("hOEMHeap", ctypes.c_void_p),
("pPublicDM", ctypes.c_void_p),
("pOEMDM", ctypes.c_void_p),
("dwFlags", wintypes.DWORD),
("pDrvOptItems", ctypes.c_void_p),
("cDrvOptItems", wintypes.DWORD),
("pOEMOptItems", ctypes.c_void_p),
("cOEMOptItems", wintypes.DWORD),
("pOEMUserData", ctypes.c_void_p),
("OEMCUIPCallback", ctypes.c_void_p),
]#[repr(C)]
pub struct OEMCUIPPARAM {
pub cbSize: u32,
pub poemuiobj: *mut core::ffi::c_void,
pub hPrinter: *mut core::ffi::c_void,
pub pPrinterName: *mut core::ffi::c_void,
pub hModule: *mut core::ffi::c_void,
pub hOEMHeap: *mut core::ffi::c_void,
pub pPublicDM: *mut core::ffi::c_void,
pub pOEMDM: *mut core::ffi::c_void,
pub dwFlags: u32,
pub pDrvOptItems: *mut core::ffi::c_void,
pub cDrvOptItems: u32,
pub pOEMOptItems: *mut core::ffi::c_void,
pub cOEMOptItems: u32,
pub pOEMUserData: *mut core::ffi::c_void,
pub OEMCUIPCallback: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type OEMCUIPPARAM struct {
cbSize uint32
poemuiobj uintptr
hPrinter uintptr
pPrinterName uintptr
hModule uintptr
hOEMHeap uintptr
pPublicDM uintptr
pOEMDM uintptr
dwFlags uint32
pDrvOptItems uintptr
cDrvOptItems uint32
pOEMOptItems uintptr
cOEMOptItems uint32
pOEMUserData uintptr
OEMCUIPCallback uintptr
}type
OEMCUIPPARAM = record
cbSize: DWORD;
poemuiobj: Pointer;
hPrinter: Pointer;
pPrinterName: Pointer;
hModule: Pointer;
hOEMHeap: Pointer;
pPublicDM: Pointer;
pOEMDM: Pointer;
dwFlags: DWORD;
pDrvOptItems: Pointer;
cDrvOptItems: DWORD;
pOEMOptItems: Pointer;
cOEMOptItems: DWORD;
pOEMUserData: Pointer;
OEMCUIPCallback: Pointer;
end;const OEMCUIPPARAM = extern struct {
cbSize: u32,
poemuiobj: ?*anyopaque,
hPrinter: ?*anyopaque,
pPrinterName: ?*anyopaque,
hModule: ?*anyopaque,
hOEMHeap: ?*anyopaque,
pPublicDM: ?*anyopaque,
pOEMDM: ?*anyopaque,
dwFlags: u32,
pDrvOptItems: ?*anyopaque,
cDrvOptItems: u32,
pOEMOptItems: ?*anyopaque,
cOEMOptItems: u32,
pOEMUserData: ?*anyopaque,
OEMCUIPCallback: ?*anyopaque,
};type
OEMCUIPPARAM {.bycopy.} = object
cbSize: uint32
poemuiobj: pointer
hPrinter: pointer
pPrinterName: pointer
hModule: pointer
hOEMHeap: pointer
pPublicDM: pointer
pOEMDM: pointer
dwFlags: uint32
pDrvOptItems: pointer
cDrvOptItems: uint32
pOEMOptItems: pointer
cOEMOptItems: uint32
pOEMUserData: pointer
OEMCUIPCallback: pointerstruct OEMCUIPPARAM
{
uint cbSize;
void* poemuiobj;
void* hPrinter;
void* pPrinterName;
void* hModule;
void* hOEMHeap;
void* pPublicDM;
void* pOEMDM;
uint dwFlags;
void* pDrvOptItems;
uint cDrvOptItems;
void* pOEMOptItems;
uint cOEMOptItems;
void* pOEMUserData;
void* OEMCUIPCallback;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OEMCUIPPARAM サイズ: 60 バイト(x86)
dim st, 15 ; 4byte整数×15(構造体サイズ 60 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; poemuiobj : OEMUIOBJ* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; hPrinter : HANDLE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pPrinterName : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; hModule : HANDLE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; hOEMHeap : HANDLE (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pPublicDM : DEVMODEA* (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; pOEMDM : void* (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwFlags : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pDrvOptItems : OPTITEM* (+36, 4byte) varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; cDrvOptItems : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; pOEMOptItems : OPTITEM* (+44, 4byte) varptr(st)+44 を基点に操作(4byte:入れ子/配列)
; cOEMOptItems : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; pOEMUserData : void* (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; OEMCUIPCallback : OEMCUIPCALLBACK (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OEMCUIPPARAM サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; poemuiobj : OEMUIOBJ* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; hPrinter : HANDLE (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pPrinterName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; hModule : HANDLE (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; hOEMHeap : HANDLE (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pPublicDM : DEVMODEA* (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; pOEMDM : void* (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; dwFlags : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; pDrvOptItems : OPTITEM* (+72, 8byte) varptr(st)+72 を基点に操作(8byte:入れ子/配列)
; cDrvOptItems : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; pOEMOptItems : OPTITEM* (+88, 8byte) varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; cOEMOptItems : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; pOEMUserData : void* (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; OEMCUIPCallback : OEMCUIPCALLBACK (+112, 8byte) qpoke st,112,値 / qpeek(st,112) ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OEMCUIPPARAM
#field int cbSize
#field intptr poemuiobj
#field intptr hPrinter
#field intptr pPrinterName
#field intptr hModule
#field intptr hOEMHeap
#field intptr pPublicDM
#field intptr pOEMDM
#field int dwFlags
#field intptr pDrvOptItems
#field int cDrvOptItems
#field intptr pOEMOptItems
#field int cOEMOptItems
#field intptr pOEMUserData
#field intptr OEMCUIPCallback
#endstruct
stdim st, OEMCUIPPARAM ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize