Win32 API 日本語リファレンス
ホームGraphics.Printing › PRINTPROCESSOR_CAPS_1

PRINTPROCESSOR_CAPS_1

構造体
サイズx64: 16 バイト / x86: 16 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwLevelDWORD4+0+0この機能情報構造体のレベル番号。
dwNupOptionsDWORD4+4+4サポートするN-up(集約印刷)枚数を示すビットマスク。
dwPageOrderFlagsDWORD4+8+8サポートするページ順序を示すビットフラグ(正順/逆順)。
dwNumberOfCopiesDWORD4+12+12サポートする最大部数。

各言語での定義

#include <windows.h>

// PRINTPROCESSOR_CAPS_1  (x64 16 / x86 16 バイト)
typedef struct PRINTPROCESSOR_CAPS_1 {
    DWORD dwLevel;
    DWORD dwNupOptions;
    DWORD dwPageOrderFlags;
    DWORD dwNumberOfCopies;
} PRINTPROCESSOR_CAPS_1;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PRINTPROCESSOR_CAPS_1
{
    public uint dwLevel;
    public uint dwNupOptions;
    public uint dwPageOrderFlags;
    public uint dwNumberOfCopies;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PRINTPROCESSOR_CAPS_1
    Public dwLevel As UInteger
    Public dwNupOptions As UInteger
    Public dwPageOrderFlags As UInteger
    Public dwNumberOfCopies As UInteger
End Structure
import ctypes
from ctypes import wintypes

class PRINTPROCESSOR_CAPS_1(ctypes.Structure):
    _fields_ = [
        ("dwLevel", wintypes.DWORD),
        ("dwNupOptions", wintypes.DWORD),
        ("dwPageOrderFlags", wintypes.DWORD),
        ("dwNumberOfCopies", wintypes.DWORD),
    ]
#[repr(C)]
pub struct PRINTPROCESSOR_CAPS_1 {
    pub dwLevel: u32,
    pub dwNupOptions: u32,
    pub dwPageOrderFlags: u32,
    pub dwNumberOfCopies: u32,
}
import "golang.org/x/sys/windows"

type PRINTPROCESSOR_CAPS_1 struct {
	dwLevel uint32
	dwNupOptions uint32
	dwPageOrderFlags uint32
	dwNumberOfCopies uint32
}
type
  PRINTPROCESSOR_CAPS_1 = record
    dwLevel: DWORD;
    dwNupOptions: DWORD;
    dwPageOrderFlags: DWORD;
    dwNumberOfCopies: DWORD;
  end;
const PRINTPROCESSOR_CAPS_1 = extern struct {
    dwLevel: u32,
    dwNupOptions: u32,
    dwPageOrderFlags: u32,
    dwNumberOfCopies: u32,
};
type
  PRINTPROCESSOR_CAPS_1 {.bycopy.} = object
    dwLevel: uint32
    dwNupOptions: uint32
    dwPageOrderFlags: uint32
    dwNumberOfCopies: uint32
struct PRINTPROCESSOR_CAPS_1
{
    uint dwLevel;
    uint dwNupOptions;
    uint dwPageOrderFlags;
    uint dwNumberOfCopies;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PRINTPROCESSOR_CAPS_1 サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; dwLevel : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwNupOptions : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwPageOrderFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwNumberOfCopies : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PRINTPROCESSOR_CAPS_1
    #field int dwLevel
    #field int dwNupOptions
    #field int dwPageOrderFlags
    #field int dwNumberOfCopies
#endstruct

stdim st, PRINTPROCESSOR_CAPS_1        ; NSTRUCT 変数を確保
st->dwLevel = 100
mes "dwLevel=" + st->dwLevel