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