ホーム › Graphics.Printing › DeletePrintProcessorW
DeletePrintProcessorW
関数指定した印刷プロセッサを削除する(Unicode版)。
シグネチャ
// winspool.drv (Unicode / -W)
#include <windows.h>
BOOL DeletePrintProcessorW(
LPCWSTR pName, // optional
LPCWSTR pEnvironment, // optional
LPCWSTR pPrintProcessorName
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pName | LPCWSTR | inoptional |
| pEnvironment | LPCWSTR | inoptional |
| pPrintProcessorName | LPCWSTR | in |
戻り値の型: BOOL
各言語での呼び出し定義
// winspool.drv (Unicode / -W)
#include <windows.h>
BOOL DeletePrintProcessorW(
LPCWSTR pName, // optional
LPCWSTR pEnvironment, // optional
LPCWSTR pPrintProcessorName
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("winspool.drv", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern bool DeletePrintProcessorW(
[MarshalAs(UnmanagedType.LPWStr)] string pName, // LPCWSTR optional
[MarshalAs(UnmanagedType.LPWStr)] string pEnvironment, // LPCWSTR optional
[MarshalAs(UnmanagedType.LPWStr)] string pPrintProcessorName // LPCWSTR
);<DllImport("winspool.drv", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function DeletePrintProcessorW(
<MarshalAs(UnmanagedType.LPWStr)> pName As String, ' LPCWSTR optional
<MarshalAs(UnmanagedType.LPWStr)> pEnvironment As String, ' LPCWSTR optional
<MarshalAs(UnmanagedType.LPWStr)> pPrintProcessorName As String ' LPCWSTR
) As Boolean
End Function' pName : LPCWSTR optional
' pEnvironment : LPCWSTR optional
' pPrintProcessorName : LPCWSTR
Declare PtrSafe Function DeletePrintProcessorW Lib "winspool.drv" ( _
ByVal pName As LongPtr, _
ByVal pEnvironment As LongPtr, _
ByVal pPrintProcessorName As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DeletePrintProcessorW = ctypes.windll.LoadLibrary("winspool.drv").DeletePrintProcessorW
DeletePrintProcessorW.restype = wintypes.BOOL
DeletePrintProcessorW.argtypes = [
wintypes.LPCWSTR, # pName : LPCWSTR optional
wintypes.LPCWSTR, # pEnvironment : LPCWSTR optional
wintypes.LPCWSTR, # pPrintProcessorName : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('winspool.drv')
DeletePrintProcessorW = Fiddle::Function.new(
lib['DeletePrintProcessorW'],
[
Fiddle::TYPE_VOIDP, # pName : LPCWSTR optional
Fiddle::TYPE_VOIDP, # pEnvironment : LPCWSTR optional
Fiddle::TYPE_VOIDP, # pPrintProcessorName : LPCWSTR
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "winspool.drv")]
extern "system" {
fn DeletePrintProcessorW(
pName: *const u16, // LPCWSTR optional
pEnvironment: *const u16, // LPCWSTR optional
pPrintProcessorName: *const u16 // LPCWSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("winspool.drv", CharSet = CharSet.Unicode)]
public static extern bool DeletePrintProcessorW([MarshalAs(UnmanagedType.LPWStr)] string pName, [MarshalAs(UnmanagedType.LPWStr)] string pEnvironment, [MarshalAs(UnmanagedType.LPWStr)] string pPrintProcessorName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winspool.drv_DeletePrintProcessorW' -Namespace Win32 -PassThru
# $api::DeletePrintProcessorW(pName, pEnvironment, pPrintProcessorName)#uselib "winspool.drv"
#func global DeletePrintProcessorW "DeletePrintProcessorW" wptr, wptr, wptr
; DeletePrintProcessorW pName, pEnvironment, pPrintProcessorName ; 戻り値は stat
; pName : LPCWSTR optional -> "wptr"
; pEnvironment : LPCWSTR optional -> "wptr"
; pPrintProcessorName : LPCWSTR -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "winspool.drv"
#cfunc global DeletePrintProcessorW "DeletePrintProcessorW" wstr, wstr, wstr
; res = DeletePrintProcessorW(pName, pEnvironment, pPrintProcessorName)
; pName : LPCWSTR optional -> "wstr"
; pEnvironment : LPCWSTR optional -> "wstr"
; pPrintProcessorName : LPCWSTR -> "wstr"; BOOL DeletePrintProcessorW(LPCWSTR pName, LPCWSTR pEnvironment, LPCWSTR pPrintProcessorName)
#uselib "winspool.drv"
#cfunc global DeletePrintProcessorW "DeletePrintProcessorW" wstr, wstr, wstr
; res = DeletePrintProcessorW(pName, pEnvironment, pPrintProcessorName)
; pName : LPCWSTR optional -> "wstr"
; pEnvironment : LPCWSTR optional -> "wstr"
; pPrintProcessorName : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winspool_drv = windows.NewLazySystemDLL("winspool.drv")
procDeletePrintProcessorW = winspool_drv.NewProc("DeletePrintProcessorW")
)
// pName (LPCWSTR optional), pEnvironment (LPCWSTR optional), pPrintProcessorName (LPCWSTR)
r1, _, err := procDeletePrintProcessorW.Call(
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pName))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pEnvironment))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pPrintProcessorName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction DeletePrintProcessorW(
pName: PWideChar; // LPCWSTR optional
pEnvironment: PWideChar; // LPCWSTR optional
pPrintProcessorName: PWideChar // LPCWSTR
): BOOL; stdcall;
external 'winspool.drv' name 'DeletePrintProcessorW';result := DllCall("winspool.drv\DeletePrintProcessorW"
, "WStr", pName ; LPCWSTR optional
, "WStr", pEnvironment ; LPCWSTR optional
, "WStr", pPrintProcessorName ; LPCWSTR
, "Int") ; return: BOOL●DeletePrintProcessorW(pName, pEnvironment, pPrintProcessorName) = DLL("winspool.drv", "bool DeletePrintProcessorW(char*, char*, char*)")
# 呼び出し: DeletePrintProcessorW(pName, pEnvironment, pPrintProcessorName)
# pName : LPCWSTR optional -> "char*"
# pEnvironment : LPCWSTR optional -> "char*"
# pPrintProcessorName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。