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

GdipDeleteBrush

関数
ブラシオブジェクトを破棄してメモリを解放する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipDeleteBrush(
    GpBrush* brush
);

パラメーター

名前方向
brushGpBrush*inout

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipDeleteBrush(
    GpBrush* brush
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipDeleteBrush(
    IntPtr brush   // GpBrush* in/out
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipDeleteBrush(
    brush As IntPtr   ' GpBrush* in/out
) As Integer
End Function
' brush : GpBrush* in/out
Declare PtrSafe Function GdipDeleteBrush Lib "gdiplus" ( _
    ByVal brush As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipDeleteBrush = ctypes.windll.gdiplus.GdipDeleteBrush
GdipDeleteBrush.restype = ctypes.c_int
GdipDeleteBrush.argtypes = [
    ctypes.c_void_p,  # brush : GpBrush* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipDeleteBrush = Fiddle::Function.new(
  lib['GdipDeleteBrush'],
  [
    Fiddle::TYPE_VOIDP,  # brush : GpBrush* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipDeleteBrush(
        brush: *mut GpBrush  // GpBrush* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipDeleteBrush(IntPtr brush);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipDeleteBrush' -Namespace Win32 -PassThru
# $api::GdipDeleteBrush(brush)
#uselib "gdiplus.dll"
#func global GdipDeleteBrush "GdipDeleteBrush" sptr
; GdipDeleteBrush varptr(brush)   ; 戻り値は stat
; brush : GpBrush* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipDeleteBrush "GdipDeleteBrush" var
; res = GdipDeleteBrush(brush)
; brush : GpBrush* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipDeleteBrush(GpBrush* brush)
#uselib "gdiplus.dll"
#cfunc global GdipDeleteBrush "GdipDeleteBrush" var
; res = GdipDeleteBrush(brush)
; brush : GpBrush* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipDeleteBrush = gdiplus.NewProc("GdipDeleteBrush")
)

// brush (GpBrush* in/out)
r1, _, err := procGdipDeleteBrush.Call(
	uintptr(brush),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipDeleteBrush(
  brush: Pointer   // GpBrush* in/out
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipDeleteBrush';
result := DllCall("gdiplus\GdipDeleteBrush"
    , "Ptr", brush   ; GpBrush* in/out
    , "Int")   ; return: Status
●GdipDeleteBrush(brush) = DLL("gdiplus.dll", "int GdipDeleteBrush(void*)")
# 呼び出し: GdipDeleteBrush(brush)
# brush : GpBrush* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。