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

GdipGetHatchBackgroundColor

関数
ハッチブラシの背景色を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetHatchBackgroundColor(
    GpHatch* brush,
    DWORD* backcol
);

パラメーター

名前方向
brushGpHatch*inout
backcolDWORD*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetHatchBackgroundColor = ctypes.windll.gdiplus.GdipGetHatchBackgroundColor
GdipGetHatchBackgroundColor.restype = ctypes.c_int
GdipGetHatchBackgroundColor.argtypes = [
    ctypes.c_void_p,  # brush : GpHatch* in/out
    ctypes.POINTER(wintypes.DWORD),  # backcol : DWORD* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetHatchBackgroundColor = gdiplus.NewProc("GdipGetHatchBackgroundColor")
)

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