ホーム › Graphics.Printing › SpoolerFindClosePrinterChangeNotification
SpoolerFindClosePrinterChangeNotification
関数スプーラーでプリンター変更通知の監視を終了する。
シグネチャ
// SPOOLSS.dll
#include <windows.h>
BOOL SpoolerFindClosePrinterChangeNotification(
PRINTER_HANDLE hPrinter
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hPrinter | PRINTER_HANDLE | in |
戻り値の型: BOOL
各言語での呼び出し定義
// SPOOLSS.dll
#include <windows.h>
BOOL SpoolerFindClosePrinterChangeNotification(
PRINTER_HANDLE hPrinter
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SPOOLSS.dll", ExactSpelling = true)]
static extern bool SpoolerFindClosePrinterChangeNotification(
PRINTER_HANDLE hPrinter // PRINTER_HANDLE
);<DllImport("SPOOLSS.dll", ExactSpelling:=True)>
Public Shared Function SpoolerFindClosePrinterChangeNotification(
hPrinter As PRINTER_HANDLE ' PRINTER_HANDLE
) As Boolean
End Function' hPrinter : PRINTER_HANDLE
Declare PtrSafe Function SpoolerFindClosePrinterChangeNotification Lib "spoolss" ( _
ByVal hPrinter As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SpoolerFindClosePrinterChangeNotification = ctypes.windll.spoolss.SpoolerFindClosePrinterChangeNotification
SpoolerFindClosePrinterChangeNotification.restype = wintypes.BOOL
SpoolerFindClosePrinterChangeNotification.argtypes = [
PRINTER_HANDLE, # hPrinter : PRINTER_HANDLE
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SPOOLSS.dll')
SpoolerFindClosePrinterChangeNotification = Fiddle::Function.new(
lib['SpoolerFindClosePrinterChangeNotification'],
[
Fiddle::TYPE_VOIDP, # hPrinter : PRINTER_HANDLE
],
Fiddle::TYPE_INT)#[link(name = "spoolss")]
extern "system" {
fn SpoolerFindClosePrinterChangeNotification(
hPrinter: PRINTER_HANDLE // PRINTER_HANDLE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SPOOLSS.dll")]
public static extern bool SpoolerFindClosePrinterChangeNotification(PRINTER_HANDLE hPrinter);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SPOOLSS_SpoolerFindClosePrinterChangeNotification' -Namespace Win32 -PassThru
# $api::SpoolerFindClosePrinterChangeNotification(hPrinter)#uselib "SPOOLSS.dll"
#func global SpoolerFindClosePrinterChangeNotification "SpoolerFindClosePrinterChangeNotification" sptr
; SpoolerFindClosePrinterChangeNotification hPrinter ; 戻り値は stat
; hPrinter : PRINTER_HANDLE -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SPOOLSS.dll"
#cfunc global SpoolerFindClosePrinterChangeNotification "SpoolerFindClosePrinterChangeNotification" int
; res = SpoolerFindClosePrinterChangeNotification(hPrinter)
; hPrinter : PRINTER_HANDLE -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。; BOOL SpoolerFindClosePrinterChangeNotification(PRINTER_HANDLE hPrinter)
#uselib "SPOOLSS.dll"
#cfunc global SpoolerFindClosePrinterChangeNotification "SpoolerFindClosePrinterChangeNotification" int
; res = SpoolerFindClosePrinterChangeNotification(hPrinter)
; hPrinter : PRINTER_HANDLE -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
spoolss = windows.NewLazySystemDLL("SPOOLSS.dll")
procSpoolerFindClosePrinterChangeNotification = spoolss.NewProc("SpoolerFindClosePrinterChangeNotification")
)
// hPrinter (PRINTER_HANDLE)
r1, _, err := procSpoolerFindClosePrinterChangeNotification.Call(
uintptr(hPrinter),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction SpoolerFindClosePrinterChangeNotification(
hPrinter: PRINTER_HANDLE // PRINTER_HANDLE
): BOOL; stdcall;
external 'SPOOLSS.dll' name 'SpoolerFindClosePrinterChangeNotification';result := DllCall("SPOOLSS\SpoolerFindClosePrinterChangeNotification"
, "Ptr", hPrinter ; PRINTER_HANDLE
, "Int") ; return: BOOL●SpoolerFindClosePrinterChangeNotification(hPrinter) = DLL("SPOOLSS.dll", "bool SpoolerFindClosePrinterChangeNotification(void*)")
# 呼び出し: SpoolerFindClosePrinterChangeNotification(hPrinter)
# hPrinter : PRINTER_HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。