ホーム › Graphics.Printing › AppendPrinterNotifyInfoData
AppendPrinterNotifyInfoData
関数プリンター通知情報にデータを追加する。
シグネチャ
// SPOOLSS.dll
#include <windows.h>
BOOL AppendPrinterNotifyInfoData(
PRINTER_NOTIFY_INFO* pInfoDest,
PRINTER_NOTIFY_INFO_DATA* pDataSrc, // optional
DWORD fdwFlags
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pInfoDest | PRINTER_NOTIFY_INFO* | in |
| pDataSrc | PRINTER_NOTIFY_INFO_DATA* | inoptional |
| fdwFlags | DWORD | in |
戻り値の型: BOOL
各言語での呼び出し定義
// SPOOLSS.dll
#include <windows.h>
BOOL AppendPrinterNotifyInfoData(
PRINTER_NOTIFY_INFO* pInfoDest,
PRINTER_NOTIFY_INFO_DATA* pDataSrc, // optional
DWORD fdwFlags
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SPOOLSS.dll", ExactSpelling = true)]
static extern bool AppendPrinterNotifyInfoData(
IntPtr pInfoDest, // PRINTER_NOTIFY_INFO*
IntPtr pDataSrc, // PRINTER_NOTIFY_INFO_DATA* optional
uint fdwFlags // DWORD
);<DllImport("SPOOLSS.dll", ExactSpelling:=True)>
Public Shared Function AppendPrinterNotifyInfoData(
pInfoDest As IntPtr, ' PRINTER_NOTIFY_INFO*
pDataSrc As IntPtr, ' PRINTER_NOTIFY_INFO_DATA* optional
fdwFlags As UInteger ' DWORD
) As Boolean
End Function' pInfoDest : PRINTER_NOTIFY_INFO*
' pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional
' fdwFlags : DWORD
Declare PtrSafe Function AppendPrinterNotifyInfoData Lib "spoolss" ( _
ByVal pInfoDest As LongPtr, _
ByVal pDataSrc As LongPtr, _
ByVal fdwFlags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AppendPrinterNotifyInfoData = ctypes.windll.spoolss.AppendPrinterNotifyInfoData
AppendPrinterNotifyInfoData.restype = wintypes.BOOL
AppendPrinterNotifyInfoData.argtypes = [
ctypes.c_void_p, # pInfoDest : PRINTER_NOTIFY_INFO*
ctypes.c_void_p, # pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional
wintypes.DWORD, # fdwFlags : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SPOOLSS.dll')
AppendPrinterNotifyInfoData = Fiddle::Function.new(
lib['AppendPrinterNotifyInfoData'],
[
Fiddle::TYPE_VOIDP, # pInfoDest : PRINTER_NOTIFY_INFO*
Fiddle::TYPE_VOIDP, # pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional
-Fiddle::TYPE_INT, # fdwFlags : DWORD
],
Fiddle::TYPE_INT)#[link(name = "spoolss")]
extern "system" {
fn AppendPrinterNotifyInfoData(
pInfoDest: *mut PRINTER_NOTIFY_INFO, // PRINTER_NOTIFY_INFO*
pDataSrc: *mut PRINTER_NOTIFY_INFO_DATA, // PRINTER_NOTIFY_INFO_DATA* optional
fdwFlags: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SPOOLSS.dll")]
public static extern bool AppendPrinterNotifyInfoData(IntPtr pInfoDest, IntPtr pDataSrc, uint fdwFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SPOOLSS_AppendPrinterNotifyInfoData' -Namespace Win32 -PassThru
# $api::AppendPrinterNotifyInfoData(pInfoDest, pDataSrc, fdwFlags)#uselib "SPOOLSS.dll"
#func global AppendPrinterNotifyInfoData "AppendPrinterNotifyInfoData" sptr, sptr, sptr
; AppendPrinterNotifyInfoData varptr(pInfoDest), varptr(pDataSrc), fdwFlags ; 戻り値は stat
; pInfoDest : PRINTER_NOTIFY_INFO* -> "sptr"
; pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional -> "sptr"
; fdwFlags : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "SPOOLSS.dll" #cfunc global AppendPrinterNotifyInfoData "AppendPrinterNotifyInfoData" var, var, int ; res = AppendPrinterNotifyInfoData(pInfoDest, pDataSrc, fdwFlags) ; pInfoDest : PRINTER_NOTIFY_INFO* -> "var" ; pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional -> "var" ; fdwFlags : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SPOOLSS.dll" #cfunc global AppendPrinterNotifyInfoData "AppendPrinterNotifyInfoData" sptr, sptr, int ; res = AppendPrinterNotifyInfoData(varptr(pInfoDest), varptr(pDataSrc), fdwFlags) ; pInfoDest : PRINTER_NOTIFY_INFO* -> "sptr" ; pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional -> "sptr" ; fdwFlags : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL AppendPrinterNotifyInfoData(PRINTER_NOTIFY_INFO* pInfoDest, PRINTER_NOTIFY_INFO_DATA* pDataSrc, DWORD fdwFlags) #uselib "SPOOLSS.dll" #cfunc global AppendPrinterNotifyInfoData "AppendPrinterNotifyInfoData" var, var, int ; res = AppendPrinterNotifyInfoData(pInfoDest, pDataSrc, fdwFlags) ; pInfoDest : PRINTER_NOTIFY_INFO* -> "var" ; pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional -> "var" ; fdwFlags : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL AppendPrinterNotifyInfoData(PRINTER_NOTIFY_INFO* pInfoDest, PRINTER_NOTIFY_INFO_DATA* pDataSrc, DWORD fdwFlags) #uselib "SPOOLSS.dll" #cfunc global AppendPrinterNotifyInfoData "AppendPrinterNotifyInfoData" intptr, intptr, int ; res = AppendPrinterNotifyInfoData(varptr(pInfoDest), varptr(pDataSrc), fdwFlags) ; pInfoDest : PRINTER_NOTIFY_INFO* -> "intptr" ; pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional -> "intptr" ; fdwFlags : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
spoolss = windows.NewLazySystemDLL("SPOOLSS.dll")
procAppendPrinterNotifyInfoData = spoolss.NewProc("AppendPrinterNotifyInfoData")
)
// pInfoDest (PRINTER_NOTIFY_INFO*), pDataSrc (PRINTER_NOTIFY_INFO_DATA* optional), fdwFlags (DWORD)
r1, _, err := procAppendPrinterNotifyInfoData.Call(
uintptr(pInfoDest),
uintptr(pDataSrc),
uintptr(fdwFlags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction AppendPrinterNotifyInfoData(
pInfoDest: Pointer; // PRINTER_NOTIFY_INFO*
pDataSrc: Pointer; // PRINTER_NOTIFY_INFO_DATA* optional
fdwFlags: DWORD // DWORD
): BOOL; stdcall;
external 'SPOOLSS.dll' name 'AppendPrinterNotifyInfoData';result := DllCall("SPOOLSS\AppendPrinterNotifyInfoData"
, "Ptr", pInfoDest ; PRINTER_NOTIFY_INFO*
, "Ptr", pDataSrc ; PRINTER_NOTIFY_INFO_DATA* optional
, "UInt", fdwFlags ; DWORD
, "Int") ; return: BOOL●AppendPrinterNotifyInfoData(pInfoDest, pDataSrc, fdwFlags) = DLL("SPOOLSS.dll", "bool AppendPrinterNotifyInfoData(void*, void*, dword)")
# 呼び出し: AppendPrinterNotifyInfoData(pInfoDest, pDataSrc, fdwFlags)
# pInfoDest : PRINTER_NOTIFY_INFO* -> "void*"
# pDataSrc : PRINTER_NOTIFY_INFO_DATA* optional -> "void*"
# fdwFlags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。