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

DeletePrintProcessorA

関数
指定した印刷プロセッサを削除する(ANSI版)。
DLLwinspool.drv文字セットANSI (-A)呼出規約winapi

シグネチャ

// winspool.drv  (ANSI / -A)
#include <windows.h>

BOOL DeletePrintProcessorA(
    LPCSTR pName,   // optional
    LPCSTR pEnvironment,   // optional
    LPCSTR pPrintProcessorName
);

パラメーター

名前方向
pNameLPCSTRinoptional
pEnvironmentLPCSTRinoptional
pPrintProcessorNameLPCSTRin

戻り値の型: BOOL

各言語での呼び出し定義

// winspool.drv  (ANSI / -A)
#include <windows.h>

BOOL DeletePrintProcessorA(
    LPCSTR pName,   // optional
    LPCSTR pEnvironment,   // optional
    LPCSTR pPrintProcessorName
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("winspool.drv", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern bool DeletePrintProcessorA(
    [MarshalAs(UnmanagedType.LPStr)] string pName,   // LPCSTR optional
    [MarshalAs(UnmanagedType.LPStr)] string pEnvironment,   // LPCSTR optional
    [MarshalAs(UnmanagedType.LPStr)] string pPrintProcessorName   // LPCSTR
);
<DllImport("winspool.drv", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function DeletePrintProcessorA(
    <MarshalAs(UnmanagedType.LPStr)> pName As String,   ' LPCSTR optional
    <MarshalAs(UnmanagedType.LPStr)> pEnvironment As String,   ' LPCSTR optional
    <MarshalAs(UnmanagedType.LPStr)> pPrintProcessorName As String   ' LPCSTR
) As Boolean
End Function
' pName : LPCSTR optional
' pEnvironment : LPCSTR optional
' pPrintProcessorName : LPCSTR
Declare PtrSafe Function DeletePrintProcessorA Lib "winspool.drv" ( _
    ByVal pName As String, _
    ByVal pEnvironment As String, _
    ByVal pPrintProcessorName As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DeletePrintProcessorA = ctypes.windll.LoadLibrary("winspool.drv").DeletePrintProcessorA
DeletePrintProcessorA.restype = wintypes.BOOL
DeletePrintProcessorA.argtypes = [
    wintypes.LPCSTR,  # pName : LPCSTR optional
    wintypes.LPCSTR,  # pEnvironment : LPCSTR optional
    wintypes.LPCSTR,  # pPrintProcessorName : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('winspool.drv')
DeletePrintProcessorA = Fiddle::Function.new(
  lib['DeletePrintProcessorA'],
  [
    Fiddle::TYPE_VOIDP,  # pName : LPCSTR optional
    Fiddle::TYPE_VOIDP,  # pEnvironment : LPCSTR optional
    Fiddle::TYPE_VOIDP,  # pPrintProcessorName : LPCSTR
  ],
  Fiddle::TYPE_INT)
#[link(name = "winspool.drv")]
extern "system" {
    fn DeletePrintProcessorA(
        pName: *const u8,  // LPCSTR optional
        pEnvironment: *const u8,  // LPCSTR optional
        pPrintProcessorName: *const u8  // LPCSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("winspool.drv", CharSet = CharSet.Ansi)]
public static extern bool DeletePrintProcessorA([MarshalAs(UnmanagedType.LPStr)] string pName, [MarshalAs(UnmanagedType.LPStr)] string pEnvironment, [MarshalAs(UnmanagedType.LPStr)] string pPrintProcessorName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winspool.drv_DeletePrintProcessorA' -Namespace Win32 -PassThru
# $api::DeletePrintProcessorA(pName, pEnvironment, pPrintProcessorName)
#uselib "winspool.drv"
#func global DeletePrintProcessorA "DeletePrintProcessorA" sptr, sptr, sptr
; DeletePrintProcessorA pName, pEnvironment, pPrintProcessorName   ; 戻り値は stat
; pName : LPCSTR optional -> "sptr"
; pEnvironment : LPCSTR optional -> "sptr"
; pPrintProcessorName : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "winspool.drv"
#cfunc global DeletePrintProcessorA "DeletePrintProcessorA" str, str, str
; res = DeletePrintProcessorA(pName, pEnvironment, pPrintProcessorName)
; pName : LPCSTR optional -> "str"
; pEnvironment : LPCSTR optional -> "str"
; pPrintProcessorName : LPCSTR -> "str"
; BOOL DeletePrintProcessorA(LPCSTR pName, LPCSTR pEnvironment, LPCSTR pPrintProcessorName)
#uselib "winspool.drv"
#cfunc global DeletePrintProcessorA "DeletePrintProcessorA" str, str, str
; res = DeletePrintProcessorA(pName, pEnvironment, pPrintProcessorName)
; pName : LPCSTR optional -> "str"
; pEnvironment : LPCSTR optional -> "str"
; pPrintProcessorName : LPCSTR -> "str"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winspool_drv = windows.NewLazySystemDLL("winspool.drv")
	procDeletePrintProcessorA = winspool_drv.NewProc("DeletePrintProcessorA")
)

// pName (LPCSTR optional), pEnvironment (LPCSTR optional), pPrintProcessorName (LPCSTR)
r1, _, err := procDeletePrintProcessorA.Call(
	uintptr(unsafe.Pointer(windows.BytePtrFromString(pName))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(pEnvironment))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(pPrintProcessorName))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function DeletePrintProcessorA(
  pName: PAnsiChar;   // LPCSTR optional
  pEnvironment: PAnsiChar;   // LPCSTR optional
  pPrintProcessorName: PAnsiChar   // LPCSTR
): BOOL; stdcall;
  external 'winspool.drv' name 'DeletePrintProcessorA';
result := DllCall("winspool.drv\DeletePrintProcessorA"
    , "AStr", pName   ; LPCSTR optional
    , "AStr", pEnvironment   ; LPCSTR optional
    , "AStr", pPrintProcessorName   ; LPCSTR
    , "Int")   ; return: BOOL
●DeletePrintProcessorA(pName, pEnvironment, pPrintProcessorName) = DLL("winspool.drv", "bool DeletePrintProcessorA(char*, char*, char*)")
# 呼び出し: DeletePrintProcessorA(pName, pEnvironment, pPrintProcessorName)
# pName : LPCSTR optional -> "char*"
# pEnvironment : LPCSTR optional -> "char*"
# pPrintProcessorName : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。