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

GdipGetCellDescent

関数
フォントファミリーのセルディセント値を取得する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

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

Status GdipGetCellDescent(
    const GpFontFamily* family,
    INT style,
    WORD* CellDescent
);

パラメーター

名前方向
familyGpFontFamily*in
styleINTin
CellDescentWORD*inout

戻り値の型: Status

各言語での呼び出し定義

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

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

GdipGetCellDescent = ctypes.windll.gdiplus.GdipGetCellDescent
GdipGetCellDescent.restype = ctypes.c_int
GdipGetCellDescent.argtypes = [
    ctypes.c_void_p,  # family : GpFontFamily*
    ctypes.c_int,  # style : INT
    ctypes.POINTER(ctypes.c_ushort),  # CellDescent : WORD* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipGetCellDescent = gdiplus.NewProc("GdipGetCellDescent")
)

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