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

GdipGetHatchStyle

関数
ハッチブラシのハッチスタイルを取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetHatchStyle(
    GpHatch* brush,
    HatchStyle* hatchstyle
);

パラメーター

名前方向
brushGpHatch*inout
hatchstyleHatchStyle*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetHatchStyle = ctypes.windll.gdiplus.GdipGetHatchStyle
GdipGetHatchStyle.restype = ctypes.c_int
GdipGetHatchStyle.argtypes = [
    ctypes.c_void_p,  # brush : GpHatch* in/out
    ctypes.c_void_p,  # hatchstyle : HatchStyle* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetHatchStyle = gdiplus.NewProc("GdipGetHatchStyle")
)

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