ホーム › Graphics.Printing › FORM_INFO_2W
FORM_INFO_2W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Flags | DWORD | 4 | +0 | +0 | 用紙(フォーム)の種別を示すビットフラグ。 |
| pName | LPWSTR | 8/4 | +8 | +4 | フォーム名(Unicode)へのポインタ。 |
| Size | SIZE | 8 | +16 | +8 | 用紙の寸法を示すSIZE(マイクロメートル単位)。 |
| ImageableArea | RECTL | 16 | +24 | +16 | 印刷可能領域を示すRECTL(マイクロメートル単位)。 |
| pKeyword | LPSTR | 8/4 | +40 | +32 | 言語非依存のフォームキーワード(ANSI)へのポインタ。 |
| StringType | DWORD | 4 | +48 | +36 | 表示名文字列の供給方法を示す値(STRING_MUIDLL等)。 |
| pMuiDll | LPWSTR | 8/4 | +56 | +40 | MUIリソースDLLのパス(Unicode)へのポインタ。 |
| dwResourceId | DWORD | 4 | +64 | +44 | MUI DLL内の表示名リソースID。 |
| pDisplayName | LPWSTR | 8/4 | +72 | +48 | ユーザー向け表示名(Unicode)へのポインタ。 |
| wLangId | WORD | 2 | +80 | +52 | 表示名の言語識別子(LANGID)。 |
各言語での定義
#include <windows.h>
// SIZE (x64 8 / x86 8 バイト)
typedef struct SIZE {
INT cx;
INT cy;
} SIZE;
// RECTL (x64 16 / x86 16 バイト)
typedef struct RECTL {
INT left;
INT top;
INT right;
INT bottom;
} RECTL;
// FORM_INFO_2W (x64 88 / x86 56 バイト)
typedef struct FORM_INFO_2W {
DWORD Flags;
LPWSTR pName;
SIZE Size;
RECTL ImageableArea;
LPSTR pKeyword;
DWORD StringType;
LPWSTR pMuiDll;
DWORD dwResourceId;
LPWSTR pDisplayName;
WORD wLangId;
} FORM_INFO_2W;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIZE
{
public int cx;
public int cy;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECTL
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FORM_INFO_2W
{
public uint Flags;
public IntPtr pName;
public SIZE Size;
public RECTL ImageableArea;
public IntPtr pKeyword;
public uint StringType;
public IntPtr pMuiDll;
public uint dwResourceId;
public IntPtr pDisplayName;
public ushort wLangId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SIZE
Public cx As Integer
Public cy As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECTL
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FORM_INFO_2W
Public Flags As UInteger
Public pName As IntPtr
Public Size As SIZE
Public ImageableArea As RECTL
Public pKeyword As IntPtr
Public StringType As UInteger
Public pMuiDll As IntPtr
Public dwResourceId As UInteger
Public pDisplayName As IntPtr
Public wLangId As UShort
End Structureimport ctypes
from ctypes import wintypes
class SIZE(ctypes.Structure):
_fields_ = [
("cx", ctypes.c_int),
("cy", ctypes.c_int),
]
class RECTL(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class FORM_INFO_2W(ctypes.Structure):
_fields_ = [
("Flags", wintypes.DWORD),
("pName", ctypes.c_void_p),
("Size", SIZE),
("ImageableArea", RECTL),
("pKeyword", ctypes.c_void_p),
("StringType", wintypes.DWORD),
("pMuiDll", ctypes.c_void_p),
("dwResourceId", wintypes.DWORD),
("pDisplayName", ctypes.c_void_p),
("wLangId", ctypes.c_ushort),
]#[repr(C)]
pub struct SIZE {
pub cx: i32,
pub cy: i32,
}
#[repr(C)]
pub struct RECTL {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct FORM_INFO_2W {
pub Flags: u32,
pub pName: *mut core::ffi::c_void,
pub Size: SIZE,
pub ImageableArea: RECTL,
pub pKeyword: *mut core::ffi::c_void,
pub StringType: u32,
pub pMuiDll: *mut core::ffi::c_void,
pub dwResourceId: u32,
pub pDisplayName: *mut core::ffi::c_void,
pub wLangId: u16,
}import "golang.org/x/sys/windows"
type SIZE struct {
cx int32
cy int32
}
type RECTL struct {
left int32
top int32
right int32
bottom int32
}
type FORM_INFO_2W struct {
Flags uint32
pName uintptr
Size SIZE
ImageableArea RECTL
pKeyword uintptr
StringType uint32
pMuiDll uintptr
dwResourceId uint32
pDisplayName uintptr
wLangId uint16
}type
SIZE = record
cx: Integer;
cy: Integer;
end;
RECTL = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
FORM_INFO_2W = record
Flags: DWORD;
pName: Pointer;
Size: SIZE;
ImageableArea: RECTL;
pKeyword: Pointer;
StringType: DWORD;
pMuiDll: Pointer;
dwResourceId: DWORD;
pDisplayName: Pointer;
wLangId: Word;
end;const SIZE = extern struct {
cx: i32,
cy: i32,
};
const RECTL = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const FORM_INFO_2W = extern struct {
Flags: u32,
pName: ?*anyopaque,
Size: SIZE,
ImageableArea: RECTL,
pKeyword: ?*anyopaque,
StringType: u32,
pMuiDll: ?*anyopaque,
dwResourceId: u32,
pDisplayName: ?*anyopaque,
wLangId: u16,
};type
SIZE {.bycopy.} = object
cx: int32
cy: int32
RECTL {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
FORM_INFO_2W {.bycopy.} = object
Flags: uint32
pName: pointer
Size: SIZE
ImageableArea: RECTL
pKeyword: pointer
StringType: uint32
pMuiDll: pointer
dwResourceId: uint32
pDisplayName: pointer
wLangId: uint16struct SIZE
{
int cx;
int cy;
}
struct RECTL
{
int left;
int top;
int right;
int bottom;
}
struct FORM_INFO_2W
{
uint Flags;
void* pName;
SIZE Size;
RECTL ImageableArea;
void* pKeyword;
uint StringType;
void* pMuiDll;
uint dwResourceId;
void* pDisplayName;
ushort wLangId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; FORM_INFO_2W サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pName : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Size : SIZE (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ImageableArea : RECTL (+16, 16byte) varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; pKeyword : LPSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; StringType : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pMuiDll : LPWSTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwResourceId : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; pDisplayName : LPWSTR (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; wLangId : WORD (+52, 2byte) wpoke st,52,値 / 値 = wpeek(st,52)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FORM_INFO_2W サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; Flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pName : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Size : SIZE (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ImageableArea : RECTL (+24, 16byte) varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; pKeyword : LPSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; StringType : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; pMuiDll : LPWSTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; dwResourceId : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; pDisplayName : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; wLangId : WORD (+80, 2byte) wpoke st,80,値 / 値 = wpeek(st,80)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SIZE
#field int cx
#field int cy
#endstruct
#defstruct global RECTL
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global FORM_INFO_2W
#field int Flags
#field intptr pName
#field SIZE Size
#field RECTL ImageableArea
#field intptr pKeyword
#field int StringType
#field intptr pMuiDll
#field int dwResourceId
#field intptr pDisplayName
#field short wLangId
#endstruct
stdim st, FORM_INFO_2W ; NSTRUCT 変数を確保
st->Flags = 100
mes "Flags=" + st->Flags