Win32 API 日本語リファレンス
ホームGraphics.Printing › ProvidorFindClosePrinterChangeNotification

ProvidorFindClosePrinterChangeNotification

関数
プロバイダーでプリンター変更通知の監視を終了する。
DLLSPOOLSS.dll呼出規約winapi

シグネチャ

// SPOOLSS.dll
#include <windows.h>

BOOL ProvidorFindClosePrinterChangeNotification(
    PRINTER_HANDLE hPrinter
);

パラメーター

名前方向
hPrinterPRINTER_HANDLEin

戻り値の型: BOOL

各言語での呼び出し定義

// SPOOLSS.dll
#include <windows.h>

BOOL ProvidorFindClosePrinterChangeNotification(
    PRINTER_HANDLE hPrinter
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SPOOLSS.dll", ExactSpelling = true)]
static extern bool ProvidorFindClosePrinterChangeNotification(
    PRINTER_HANDLE hPrinter   // PRINTER_HANDLE
);
<DllImport("SPOOLSS.dll", ExactSpelling:=True)>
Public Shared Function ProvidorFindClosePrinterChangeNotification(
    hPrinter As PRINTER_HANDLE   ' PRINTER_HANDLE
) As Boolean
End Function
' hPrinter : PRINTER_HANDLE
Declare PtrSafe Function ProvidorFindClosePrinterChangeNotification 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

ProvidorFindClosePrinterChangeNotification = ctypes.windll.spoolss.ProvidorFindClosePrinterChangeNotification
ProvidorFindClosePrinterChangeNotification.restype = wintypes.BOOL
ProvidorFindClosePrinterChangeNotification.argtypes = [
    PRINTER_HANDLE,  # hPrinter : PRINTER_HANDLE
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SPOOLSS.dll')
ProvidorFindClosePrinterChangeNotification = Fiddle::Function.new(
  lib['ProvidorFindClosePrinterChangeNotification'],
  [
    Fiddle::TYPE_VOIDP,  # hPrinter : PRINTER_HANDLE
  ],
  Fiddle::TYPE_INT)
#[link(name = "spoolss")]
extern "system" {
    fn ProvidorFindClosePrinterChangeNotification(
        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 ProvidorFindClosePrinterChangeNotification(PRINTER_HANDLE hPrinter);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SPOOLSS_ProvidorFindClosePrinterChangeNotification' -Namespace Win32 -PassThru
# $api::ProvidorFindClosePrinterChangeNotification(hPrinter)
#uselib "SPOOLSS.dll"
#func global ProvidorFindClosePrinterChangeNotification "ProvidorFindClosePrinterChangeNotification" sptr
; ProvidorFindClosePrinterChangeNotification hPrinter   ; 戻り値は stat
; hPrinter : PRINTER_HANDLE -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SPOOLSS.dll"
#cfunc global ProvidorFindClosePrinterChangeNotification "ProvidorFindClosePrinterChangeNotification" int
; res = ProvidorFindClosePrinterChangeNotification(hPrinter)
; hPrinter : PRINTER_HANDLE -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; BOOL ProvidorFindClosePrinterChangeNotification(PRINTER_HANDLE hPrinter)
#uselib "SPOOLSS.dll"
#cfunc global ProvidorFindClosePrinterChangeNotification "ProvidorFindClosePrinterChangeNotification" int
; res = ProvidorFindClosePrinterChangeNotification(hPrinter)
; hPrinter : PRINTER_HANDLE -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	spoolss = windows.NewLazySystemDLL("SPOOLSS.dll")
	procProvidorFindClosePrinterChangeNotification = spoolss.NewProc("ProvidorFindClosePrinterChangeNotification")
)

// hPrinter (PRINTER_HANDLE)
r1, _, err := procProvidorFindClosePrinterChangeNotification.Call(
	uintptr(hPrinter),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function ProvidorFindClosePrinterChangeNotification(
  hPrinter: PRINTER_HANDLE   // PRINTER_HANDLE
): BOOL; stdcall;
  external 'SPOOLSS.dll' name 'ProvidorFindClosePrinterChangeNotification';
result := DllCall("SPOOLSS\ProvidorFindClosePrinterChangeNotification"
    , "Ptr", hPrinter   ; PRINTER_HANDLE
    , "Int")   ; return: BOOL
●ProvidorFindClosePrinterChangeNotification(hPrinter) = DLL("SPOOLSS.dll", "bool ProvidorFindClosePrinterChangeNotification(void*)")
# 呼び出し: ProvidorFindClosePrinterChangeNotification(hPrinter)
# hPrinter : PRINTER_HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。