ホーム › Graphics.Printing › JOB_INFO_1A
JOB_INFO_1A
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| JobId | DWORD | 4 | +0 | +0 | 印刷ジョブを識別する一意のID。 |
| pPrinterName | LPSTR | 8/4 | +8 | +4 | ジョブを処理するプリンタ名(ANSI)へのポインタ。 |
| pMachineName | LPSTR | 8/4 | +16 | +8 | ジョブを作成したマシン名(ANSI)へのポインタ。 |
| pUserName | LPSTR | 8/4 | +24 | +12 | ジョブを送信したユーザー名(ANSI)へのポインタ。 |
| pDocument | LPSTR | 8/4 | +32 | +16 | 印刷ドキュメント名(ANSI)へのポインタ。 |
| pDatatype | LPSTR | 8/4 | +40 | +20 | 印刷データ型(RAW/EMF等)(ANSI)へのポインタ。 |
| pStatus | LPSTR | 8/4 | +48 | +24 | ジョブ状態を表す文字列(ANSI)へのポインタ。NULL可。 |
| Status | DWORD | 4 | +56 | +28 | ジョブの状態を示すビットフラグ(JOB_STATUS_*)。 |
| Priority | DWORD | 4 | +60 | +32 | ジョブの優先度(1~99)。 |
| Position | DWORD | 4 | +64 | +36 | キュー内のジョブ位置。 |
| TotalPages | DWORD | 4 | +68 | +40 | ドキュメントの総ページ数。 |
| PagesPrinted | DWORD | 4 | +72 | +44 | 現在までに印刷されたページ数。 |
| Submitted | SYSTEMTIME | 16 | +76 | +48 | ジョブが投入された日時を示すSYSTEMTIME。 |
各言語での定義
#include <windows.h>
// SYSTEMTIME (x64 16 / x86 16 バイト)
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
// JOB_INFO_1A (x64 96 / x86 64 バイト)
typedef struct JOB_INFO_1A {
DWORD JobId;
LPSTR pPrinterName;
LPSTR pMachineName;
LPSTR pUserName;
LPSTR pDocument;
LPSTR pDatatype;
LPSTR pStatus;
DWORD Status;
DWORD Priority;
DWORD Position;
DWORD TotalPages;
DWORD PagesPrinted;
SYSTEMTIME Submitted;
} JOB_INFO_1A;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOB_INFO_1A
{
public uint JobId;
public IntPtr pPrinterName;
public IntPtr pMachineName;
public IntPtr pUserName;
public IntPtr pDocument;
public IntPtr pDatatype;
public IntPtr pStatus;
public uint Status;
public uint Priority;
public uint Position;
public uint TotalPages;
public uint PagesPrinted;
public SYSTEMTIME Submitted;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEMTIME
Public wYear As UShort
Public wMonth As UShort
Public wDayOfWeek As UShort
Public wDay As UShort
Public wHour As UShort
Public wMinute As UShort
Public wSecond As UShort
Public wMilliseconds As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOB_INFO_1A
Public JobId As UInteger
Public pPrinterName As IntPtr
Public pMachineName As IntPtr
Public pUserName As IntPtr
Public pDocument As IntPtr
Public pDatatype As IntPtr
Public pStatus As IntPtr
Public Status As UInteger
Public Priority As UInteger
Public Position As UInteger
Public TotalPages As UInteger
Public PagesPrinted As UInteger
Public Submitted As SYSTEMTIME
End Structureimport ctypes
from ctypes import wintypes
class SYSTEMTIME(ctypes.Structure):
_fields_ = [
("wYear", ctypes.c_ushort),
("wMonth", ctypes.c_ushort),
("wDayOfWeek", ctypes.c_ushort),
("wDay", ctypes.c_ushort),
("wHour", ctypes.c_ushort),
("wMinute", ctypes.c_ushort),
("wSecond", ctypes.c_ushort),
("wMilliseconds", ctypes.c_ushort),
]
class JOB_INFO_1A(ctypes.Structure):
_fields_ = [
("JobId", wintypes.DWORD),
("pPrinterName", ctypes.c_void_p),
("pMachineName", ctypes.c_void_p),
("pUserName", ctypes.c_void_p),
("pDocument", ctypes.c_void_p),
("pDatatype", ctypes.c_void_p),
("pStatus", ctypes.c_void_p),
("Status", wintypes.DWORD),
("Priority", wintypes.DWORD),
("Position", wintypes.DWORD),
("TotalPages", wintypes.DWORD),
("PagesPrinted", wintypes.DWORD),
("Submitted", SYSTEMTIME),
]#[repr(C)]
pub struct SYSTEMTIME {
pub wYear: u16,
pub wMonth: u16,
pub wDayOfWeek: u16,
pub wDay: u16,
pub wHour: u16,
pub wMinute: u16,
pub wSecond: u16,
pub wMilliseconds: u16,
}
#[repr(C)]
pub struct JOB_INFO_1A {
pub JobId: u32,
pub pPrinterName: *mut core::ffi::c_void,
pub pMachineName: *mut core::ffi::c_void,
pub pUserName: *mut core::ffi::c_void,
pub pDocument: *mut core::ffi::c_void,
pub pDatatype: *mut core::ffi::c_void,
pub pStatus: *mut core::ffi::c_void,
pub Status: u32,
pub Priority: u32,
pub Position: u32,
pub TotalPages: u32,
pub PagesPrinted: u32,
pub Submitted: SYSTEMTIME,
}import "golang.org/x/sys/windows"
type SYSTEMTIME struct {
wYear uint16
wMonth uint16
wDayOfWeek uint16
wDay uint16
wHour uint16
wMinute uint16
wSecond uint16
wMilliseconds uint16
}
type JOB_INFO_1A struct {
JobId uint32
pPrinterName uintptr
pMachineName uintptr
pUserName uintptr
pDocument uintptr
pDatatype uintptr
pStatus uintptr
Status uint32
Priority uint32
Position uint32
TotalPages uint32
PagesPrinted uint32
Submitted SYSTEMTIME
}type
SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;
JOB_INFO_1A = record
JobId: DWORD;
pPrinterName: Pointer;
pMachineName: Pointer;
pUserName: Pointer;
pDocument: Pointer;
pDatatype: Pointer;
pStatus: Pointer;
Status: DWORD;
Priority: DWORD;
Position: DWORD;
TotalPages: DWORD;
PagesPrinted: DWORD;
Submitted: SYSTEMTIME;
end;const SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};
const JOB_INFO_1A = extern struct {
JobId: u32,
pPrinterName: ?*anyopaque,
pMachineName: ?*anyopaque,
pUserName: ?*anyopaque,
pDocument: ?*anyopaque,
pDatatype: ?*anyopaque,
pStatus: ?*anyopaque,
Status: u32,
Priority: u32,
Position: u32,
TotalPages: u32,
PagesPrinted: u32,
Submitted: SYSTEMTIME,
};type
SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16
JOB_INFO_1A {.bycopy.} = object
JobId: uint32
pPrinterName: pointer
pMachineName: pointer
pUserName: pointer
pDocument: pointer
pDatatype: pointer
pStatus: pointer
Status: uint32
Priority: uint32
Position: uint32
TotalPages: uint32
PagesPrinted: uint32
Submitted: SYSTEMTIMEstruct SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}
struct JOB_INFO_1A
{
uint JobId;
void* pPrinterName;
void* pMachineName;
void* pUserName;
void* pDocument;
void* pDatatype;
void* pStatus;
uint Status;
uint Priority;
uint Position;
uint TotalPages;
uint PagesPrinted;
SYSTEMTIME Submitted;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JOB_INFO_1A サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; JobId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pPrinterName : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pMachineName : LPSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pUserName : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pDocument : LPSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pDatatype : LPSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pStatus : LPSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; Status : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; Priority : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Position : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; TotalPages : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; PagesPrinted : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Submitted : SYSTEMTIME (+48, 16byte) varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JOB_INFO_1A サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; JobId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pPrinterName : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pMachineName : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pUserName : LPSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pDocument : LPSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pDatatype : LPSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pStatus : LPSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; Status : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; Priority : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; Position : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; TotalPages : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; PagesPrinted : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; Submitted : SYSTEMTIME (+76, 16byte) varptr(st)+76 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SYSTEMTIME
#field short wYear
#field short wMonth
#field short wDayOfWeek
#field short wDay
#field short wHour
#field short wMinute
#field short wSecond
#field short wMilliseconds
#endstruct
#defstruct global JOB_INFO_1A
#field int JobId
#field intptr pPrinterName
#field intptr pMachineName
#field intptr pUserName
#field intptr pDocument
#field intptr pDatatype
#field intptr pStatus
#field int Status
#field int Priority
#field int Position
#field int TotalPages
#field int PagesPrinted
#field SYSTEMTIME Submitted
#endstruct
stdim st, JOB_INFO_1A ; NSTRUCT 変数を確保
st->JobId = 100
mes "JobId=" + st->JobId