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

RemoveFontResourceA

関数
追加したフォントリソースをシステムから削除する。
DLLGDI32.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// GDI32.dll  (ANSI / -A)
#include <windows.h>

BOOL RemoveFontResourceA(
    LPCSTR lpFileName
);

パラメーター

名前方向
lpFileNameLPCSTRin

戻り値の型: BOOL

各言語での呼び出し定義

// GDI32.dll  (ANSI / -A)
#include <windows.h>

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

RemoveFontResourceA = ctypes.windll.gdi32.RemoveFontResourceA
RemoveFontResourceA.restype = wintypes.BOOL
RemoveFontResourceA.argtypes = [
    wintypes.LPCSTR,  # lpFileName : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdi32 = windows.NewLazySystemDLL("GDI32.dll")
	procRemoveFontResourceA = gdi32.NewProc("RemoveFontResourceA")
)

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