ホーム › Graphics.Printing › OEMFONTINSTPARAM
OEMFONTINSTPARAM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| hPrinter | HANDLE | 8/4 | +8 | +4 | 対象プリンターのハンドル。 |
| hModule | HANDLE | 8/4 | +16 | +8 | OEMプラグインモジュールのハンドル。 |
| hHeap | HANDLE | 8/4 | +24 | +12 | 使用するヒープのハンドル。 |
| dwFlags | DWORD | 4 | +32 | +16 | フォントインストール処理を制御するフラグ。 |
| pFontInstallerName | LPWSTR | 8/4 | +40 | +20 | フォントインストーラー名を指すUnicode文字列。 |
各言語での定義
#include <windows.h>
// OEMFONTINSTPARAM (x64 48 / x86 24 バイト)
typedef struct OEMFONTINSTPARAM {
DWORD cbSize;
HANDLE hPrinter;
HANDLE hModule;
HANDLE hHeap;
DWORD dwFlags;
LPWSTR pFontInstallerName;
} OEMFONTINSTPARAM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OEMFONTINSTPARAM
{
public uint cbSize;
public IntPtr hPrinter;
public IntPtr hModule;
public IntPtr hHeap;
public uint dwFlags;
public IntPtr pFontInstallerName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OEMFONTINSTPARAM
Public cbSize As UInteger
Public hPrinter As IntPtr
Public hModule As IntPtr
Public hHeap As IntPtr
Public dwFlags As UInteger
Public pFontInstallerName As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class OEMFONTINSTPARAM(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("hPrinter", ctypes.c_void_p),
("hModule", ctypes.c_void_p),
("hHeap", ctypes.c_void_p),
("dwFlags", wintypes.DWORD),
("pFontInstallerName", ctypes.c_void_p),
]#[repr(C)]
pub struct OEMFONTINSTPARAM {
pub cbSize: u32,
pub hPrinter: *mut core::ffi::c_void,
pub hModule: *mut core::ffi::c_void,
pub hHeap: *mut core::ffi::c_void,
pub dwFlags: u32,
pub pFontInstallerName: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type OEMFONTINSTPARAM struct {
cbSize uint32
hPrinter uintptr
hModule uintptr
hHeap uintptr
dwFlags uint32
pFontInstallerName uintptr
}type
OEMFONTINSTPARAM = record
cbSize: DWORD;
hPrinter: Pointer;
hModule: Pointer;
hHeap: Pointer;
dwFlags: DWORD;
pFontInstallerName: Pointer;
end;const OEMFONTINSTPARAM = extern struct {
cbSize: u32,
hPrinter: ?*anyopaque,
hModule: ?*anyopaque,
hHeap: ?*anyopaque,
dwFlags: u32,
pFontInstallerName: ?*anyopaque,
};type
OEMFONTINSTPARAM {.bycopy.} = object
cbSize: uint32
hPrinter: pointer
hModule: pointer
hHeap: pointer
dwFlags: uint32
pFontInstallerName: pointerstruct OEMFONTINSTPARAM
{
uint cbSize;
void* hPrinter;
void* hModule;
void* hHeap;
uint dwFlags;
void* pFontInstallerName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OEMFONTINSTPARAM サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hPrinter : HANDLE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hModule : HANDLE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hHeap : HANDLE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFlags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pFontInstallerName : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OEMFONTINSTPARAM サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hPrinter : HANDLE (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; hModule : HANDLE (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; hHeap : HANDLE (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; dwFlags : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pFontInstallerName : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OEMFONTINSTPARAM
#field int cbSize
#field intptr hPrinter
#field intptr hModule
#field intptr hHeap
#field int dwFlags
#field intptr pFontInstallerName
#endstruct
stdim st, OEMFONTINSTPARAM ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize