ホーム › Storage.Xps › PSFEATURE_CUSTPAPER
PSFEATURE_CUSTPAPER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lOrientation | INT | 4 | +0 | +0 | カスタム用紙の向きを示す値。 |
| lWidth | INT | 4 | +4 | +4 | カスタム用紙の幅を示す値。 |
| lHeight | INT | 4 | +8 | +8 | カスタム用紙の高さを示す値。 |
| lWidthOffset | INT | 4 | +12 | +12 | 用紙の幅方向のオフセットを示す値。 |
| lHeightOffset | INT | 4 | +16 | +16 | 用紙の高さ方向のオフセットを示す値。 |
各言語での定義
#include <windows.h>
// PSFEATURE_CUSTPAPER (x64 20 / x86 20 バイト)
typedef struct PSFEATURE_CUSTPAPER {
INT lOrientation;
INT lWidth;
INT lHeight;
INT lWidthOffset;
INT lHeightOffset;
} PSFEATURE_CUSTPAPER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PSFEATURE_CUSTPAPER
{
public int lOrientation;
public int lWidth;
public int lHeight;
public int lWidthOffset;
public int lHeightOffset;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PSFEATURE_CUSTPAPER
Public lOrientation As Integer
Public lWidth As Integer
Public lHeight As Integer
Public lWidthOffset As Integer
Public lHeightOffset As Integer
End Structureimport ctypes
from ctypes import wintypes
class PSFEATURE_CUSTPAPER(ctypes.Structure):
_fields_ = [
("lOrientation", ctypes.c_int),
("lWidth", ctypes.c_int),
("lHeight", ctypes.c_int),
("lWidthOffset", ctypes.c_int),
("lHeightOffset", ctypes.c_int),
]#[repr(C)]
pub struct PSFEATURE_CUSTPAPER {
pub lOrientation: i32,
pub lWidth: i32,
pub lHeight: i32,
pub lWidthOffset: i32,
pub lHeightOffset: i32,
}import "golang.org/x/sys/windows"
type PSFEATURE_CUSTPAPER struct {
lOrientation int32
lWidth int32
lHeight int32
lWidthOffset int32
lHeightOffset int32
}type
PSFEATURE_CUSTPAPER = record
lOrientation: Integer;
lWidth: Integer;
lHeight: Integer;
lWidthOffset: Integer;
lHeightOffset: Integer;
end;const PSFEATURE_CUSTPAPER = extern struct {
lOrientation: i32,
lWidth: i32,
lHeight: i32,
lWidthOffset: i32,
lHeightOffset: i32,
};type
PSFEATURE_CUSTPAPER {.bycopy.} = object
lOrientation: int32
lWidth: int32
lHeight: int32
lWidthOffset: int32
lHeightOffset: int32struct PSFEATURE_CUSTPAPER
{
int lOrientation;
int lWidth;
int lHeight;
int lWidthOffset;
int lHeightOffset;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PSFEATURE_CUSTPAPER サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; lOrientation : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lWidth : INT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lHeight : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lWidthOffset : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lHeightOffset : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PSFEATURE_CUSTPAPER
#field int lOrientation
#field int lWidth
#field int lHeight
#field int lWidthOffset
#field int lHeightOffset
#endstruct
stdim st, PSFEATURE_CUSTPAPER ; NSTRUCT 変数を確保
st->lOrientation = 100
mes "lOrientation=" + st->lOrientation