Win32 API 日本語リファレンス
ホームDevices.Display › FONTOBJ_cGetAllGlyphHandles

FONTOBJ_cGetAllGlyphHandles

関数
フォントオブジェクトの全グリフのハンドルを取得する。
DLLGDI32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD FONTOBJ_cGetAllGlyphHandles(
    FONTOBJ* pfo,
    DWORD* phg
);

パラメーター

名前方向
pfoFONTOBJ*inout
phgDWORD*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

FONTOBJ_cGetAllGlyphHandles = ctypes.windll.gdi32.FONTOBJ_cGetAllGlyphHandles
FONTOBJ_cGetAllGlyphHandles.restype = wintypes.DWORD
FONTOBJ_cGetAllGlyphHandles.argtypes = [
    ctypes.c_void_p,  # pfo : FONTOBJ* in/out
    ctypes.POINTER(wintypes.DWORD),  # phg : DWORD* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	gdi32 = windows.NewLazySystemDLL("GDI32.dll")
	procFONTOBJ_cGetAllGlyphHandles = gdi32.NewProc("FONTOBJ_cGetAllGlyphHandles")
)

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