Win32 API 日本語リファレンス
ホームUI.Shell › OPEN_PRINTER_PROPS_INFOW

OPEN_PRINTER_PROPS_INFOW

構造体
サイズx64: 24 バイト / x86: 20 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のサイズをバイト単位で指定する。
pszSheetNameLPWSTR8/4+4+4表示するプロパティシートページの名前(Unicode)。
uSheetIndexDWORD4+12+8初期表示するプロパティシートのページインデックス。
dwFlagsDWORD4+16+12プロパティシート表示の挙動を制御するフラグ。
bModalBOOL4+20+16プロパティシートをモーダル表示するかの真偽値。

各言語での定義

#include <windows.h>

// OPEN_PRINTER_PROPS_INFOW  (x64 24 / x86 20 バイト)
#pragma pack(push, 1)
typedef struct OPEN_PRINTER_PROPS_INFOW {
    DWORD dwSize;
    LPWSTR pszSheetName;
    DWORD uSheetIndex;
    DWORD dwFlags;
    BOOL bModal;
} OPEN_PRINTER_PROPS_INFOW;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct OPEN_PRINTER_PROPS_INFOW
{
    public uint dwSize;
    public IntPtr pszSheetName;
    public uint uSheetIndex;
    public uint dwFlags;
    [MarshalAs(UnmanagedType.Bool)] public bool bModal;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure OPEN_PRINTER_PROPS_INFOW
    Public dwSize As UInteger
    Public pszSheetName As IntPtr
    Public uSheetIndex As UInteger
    Public dwFlags As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public bModal As Boolean
End Structure
import ctypes
from ctypes import wintypes

class OPEN_PRINTER_PROPS_INFOW(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("pszSheetName", ctypes.c_void_p),
        ("uSheetIndex", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("bModal", wintypes.BOOL),
    ]
#[repr(C, packed(1))]
pub struct OPEN_PRINTER_PROPS_INFOW {
    pub dwSize: u32,
    pub pszSheetName: *mut core::ffi::c_void,
    pub uSheetIndex: u32,
    pub dwFlags: u32,
    pub bModal: i32,
}
import "golang.org/x/sys/windows"

type OPEN_PRINTER_PROPS_INFOW struct {
	dwSize uint32
	pszSheetName uintptr
	uSheetIndex uint32
	dwFlags uint32
	bModal int32
}
type
  OPEN_PRINTER_PROPS_INFOW = packed record
    dwSize: DWORD;
    pszSheetName: Pointer;
    uSheetIndex: DWORD;
    dwFlags: DWORD;
    bModal: BOOL;
  end;
const OPEN_PRINTER_PROPS_INFOW = extern struct {
    dwSize: u32,
    pszSheetName: ?*anyopaque,
    uSheetIndex: u32,
    dwFlags: u32,
    bModal: i32,
};
type
  OPEN_PRINTER_PROPS_INFOW {.packed.} = object
    dwSize: uint32
    pszSheetName: pointer
    uSheetIndex: uint32
    dwFlags: uint32
    bModal: int32
align(1)
struct OPEN_PRINTER_PROPS_INFOW
{
    uint dwSize;
    void* pszSheetName;
    uint uSheetIndex;
    uint dwFlags;
    int bModal;
}

HSP用 定義

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

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

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