ホーム › UI.ColorSystem › UninstallColorProfileA
UninstallColorProfileA
関数カラープロファイルをシステムから削除する(ANSI版)。
シグネチャ
// mscms.dll (ANSI / -A)
#include <windows.h>
BOOL UninstallColorProfileA(
LPCSTR pMachineName, // optional
LPCSTR pProfileName,
BOOL bDelete
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pMachineName | LPCSTR | inoptional |
| pProfileName | LPCSTR | in |
| bDelete | BOOL | in |
戻り値の型: BOOL
各言語での呼び出し定義
// mscms.dll (ANSI / -A)
#include <windows.h>
BOOL UninstallColorProfileA(
LPCSTR pMachineName, // optional
LPCSTR pProfileName,
BOOL bDelete
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern bool UninstallColorProfileA(
[MarshalAs(UnmanagedType.LPStr)] string pMachineName, // LPCSTR optional
[MarshalAs(UnmanagedType.LPStr)] string pProfileName, // LPCSTR
bool bDelete // BOOL
);<DllImport("mscms.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function UninstallColorProfileA(
<MarshalAs(UnmanagedType.LPStr)> pMachineName As String, ' LPCSTR optional
<MarshalAs(UnmanagedType.LPStr)> pProfileName As String, ' LPCSTR
bDelete As Boolean ' BOOL
) As Boolean
End Function' pMachineName : LPCSTR optional
' pProfileName : LPCSTR
' bDelete : BOOL
Declare PtrSafe Function UninstallColorProfileA Lib "mscms" ( _
ByVal pMachineName As String, _
ByVal pProfileName As String, _
ByVal bDelete As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
UninstallColorProfileA = ctypes.windll.mscms.UninstallColorProfileA
UninstallColorProfileA.restype = wintypes.BOOL
UninstallColorProfileA.argtypes = [
wintypes.LPCSTR, # pMachineName : LPCSTR optional
wintypes.LPCSTR, # pProfileName : LPCSTR
wintypes.BOOL, # bDelete : BOOL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('mscms.dll')
UninstallColorProfileA = Fiddle::Function.new(
lib['UninstallColorProfileA'],
[
Fiddle::TYPE_VOIDP, # pMachineName : LPCSTR optional
Fiddle::TYPE_VOIDP, # pProfileName : LPCSTR
Fiddle::TYPE_INT, # bDelete : BOOL
],
Fiddle::TYPE_INT)#[link(name = "mscms")]
extern "system" {
fn UninstallColorProfileA(
pMachineName: *const u8, // LPCSTR optional
pProfileName: *const u8, // LPCSTR
bDelete: i32 // BOOL
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("mscms.dll", CharSet = CharSet.Ansi)]
public static extern bool UninstallColorProfileA([MarshalAs(UnmanagedType.LPStr)] string pMachineName, [MarshalAs(UnmanagedType.LPStr)] string pProfileName, bool bDelete);
"@
$api = Add-Type -MemberDefinition $sig -Name 'mscms_UninstallColorProfileA' -Namespace Win32 -PassThru
# $api::UninstallColorProfileA(pMachineName, pProfileName, bDelete)#uselib "mscms.dll"
#func global UninstallColorProfileA "UninstallColorProfileA" sptr, sptr, sptr
; UninstallColorProfileA pMachineName, pProfileName, bDelete ; 戻り値は stat
; pMachineName : LPCSTR optional -> "sptr"
; pProfileName : LPCSTR -> "sptr"
; bDelete : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "mscms.dll"
#cfunc global UninstallColorProfileA "UninstallColorProfileA" str, str, int
; res = UninstallColorProfileA(pMachineName, pProfileName, bDelete)
; pMachineName : LPCSTR optional -> "str"
; pProfileName : LPCSTR -> "str"
; bDelete : BOOL -> "int"; BOOL UninstallColorProfileA(LPCSTR pMachineName, LPCSTR pProfileName, BOOL bDelete)
#uselib "mscms.dll"
#cfunc global UninstallColorProfileA "UninstallColorProfileA" str, str, int
; res = UninstallColorProfileA(pMachineName, pProfileName, bDelete)
; pMachineName : LPCSTR optional -> "str"
; pProfileName : LPCSTR -> "str"
; bDelete : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mscms = windows.NewLazySystemDLL("mscms.dll")
procUninstallColorProfileA = mscms.NewProc("UninstallColorProfileA")
)
// pMachineName (LPCSTR optional), pProfileName (LPCSTR), bDelete (BOOL)
r1, _, err := procUninstallColorProfileA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(pMachineName))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(pProfileName))),
uintptr(bDelete),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction UninstallColorProfileA(
pMachineName: PAnsiChar; // LPCSTR optional
pProfileName: PAnsiChar; // LPCSTR
bDelete: BOOL // BOOL
): BOOL; stdcall;
external 'mscms.dll' name 'UninstallColorProfileA';result := DllCall("mscms\UninstallColorProfileA"
, "AStr", pMachineName ; LPCSTR optional
, "AStr", pProfileName ; LPCSTR
, "Int", bDelete ; BOOL
, "Int") ; return: BOOL●UninstallColorProfileA(pMachineName, pProfileName, bDelete) = DLL("mscms.dll", "bool UninstallColorProfileA(char*, char*, bool)")
# 呼び出し: UninstallColorProfileA(pMachineName, pProfileName, bDelete)
# pMachineName : LPCSTR optional -> "char*"
# pProfileName : LPCSTR -> "char*"
# bDelete : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。