Win32 API 日本語リファレンス
ホームStorage.Xps.Printing › XPS_JOB_STATUS

XPS_JOB_STATUS

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

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

フィールド

フィールドサイズx64x86説明
jobIdDWORD4+0+0印刷ジョブを識別するジョブID。
currentDocumentINT4+4+4処理中のドキュメント番号。
currentPageINT4+8+8処理中のページ番号。
currentPageTotalINT4+12+12現在のドキュメントの総ページ数。
completionXPS_JOB_COMPLETION4+16+16ジョブの完了状態を示すXPS_JOB_COMPLETION列挙値。
jobStatusHRESULT4+20+20ジョブのステータスを示すHRESULT値。

各言語での定義

#include <windows.h>

// XPS_JOB_STATUS  (x64 24 / x86 24 バイト)
typedef struct XPS_JOB_STATUS {
    DWORD jobId;
    INT currentDocument;
    INT currentPage;
    INT currentPageTotal;
    XPS_JOB_COMPLETION completion;
    HRESULT jobStatus;
} XPS_JOB_STATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct XPS_JOB_STATUS
{
    public uint jobId;
    public int currentDocument;
    public int currentPage;
    public int currentPageTotal;
    public int completion;
    public int jobStatus;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure XPS_JOB_STATUS
    Public jobId As UInteger
    Public currentDocument As Integer
    Public currentPage As Integer
    Public currentPageTotal As Integer
    Public completion As Integer
    Public jobStatus As Integer
End Structure
import ctypes
from ctypes import wintypes

class XPS_JOB_STATUS(ctypes.Structure):
    _fields_ = [
        ("jobId", wintypes.DWORD),
        ("currentDocument", ctypes.c_int),
        ("currentPage", ctypes.c_int),
        ("currentPageTotal", ctypes.c_int),
        ("completion", ctypes.c_int),
        ("jobStatus", ctypes.c_int),
    ]
#[repr(C)]
pub struct XPS_JOB_STATUS {
    pub jobId: u32,
    pub currentDocument: i32,
    pub currentPage: i32,
    pub currentPageTotal: i32,
    pub completion: i32,
    pub jobStatus: i32,
}
import "golang.org/x/sys/windows"

type XPS_JOB_STATUS struct {
	jobId uint32
	currentDocument int32
	currentPage int32
	currentPageTotal int32
	completion int32
	jobStatus int32
}
type
  XPS_JOB_STATUS = record
    jobId: DWORD;
    currentDocument: Integer;
    currentPage: Integer;
    currentPageTotal: Integer;
    completion: Integer;
    jobStatus: Integer;
  end;
const XPS_JOB_STATUS = extern struct {
    jobId: u32,
    currentDocument: i32,
    currentPage: i32,
    currentPageTotal: i32,
    completion: i32,
    jobStatus: i32,
};
type
  XPS_JOB_STATUS {.bycopy.} = object
    jobId: uint32
    currentDocument: int32
    currentPage: int32
    currentPageTotal: int32
    completion: int32
    jobStatus: int32
struct XPS_JOB_STATUS
{
    uint jobId;
    int currentDocument;
    int currentPage;
    int currentPageTotal;
    int completion;
    int jobStatus;
}

HSP用 定義

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

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

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