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

GdipGetFontStyle

関数
フォントのスタイル属性を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetFontStyle(
    GpFont* font,
    INT* style
);

パラメーター

名前方向
fontGpFont*inout
styleINT*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetFontStyle = ctypes.windll.gdiplus.GdipGetFontStyle
GdipGetFontStyle.restype = ctypes.c_int
GdipGetFontStyle.argtypes = [
    ctypes.c_void_p,  # font : GpFont* in/out
    ctypes.POINTER(ctypes.c_int),  # style : INT* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetFontStyle = gdiplus.NewProc("GdipGetFontStyle")
)

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