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

EngComputeGlyphSet

関数
指定コードページのグリフセットを計算して取得する。
DLLGDI32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

FD_GLYPHSET* EngComputeGlyphSet(
    INT nCodePage,
    INT nFirstChar,
    INT cChars
);

パラメーター

名前方向
nCodePageINTin
nFirstCharINTin
cCharsINTin

戻り値の型: FD_GLYPHSET*

各言語での呼び出し定義

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

FD_GLYPHSET* EngComputeGlyphSet(
    INT nCodePage,
    INT nFirstChar,
    INT cChars
);
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern IntPtr EngComputeGlyphSet(
    int nCodePage,   // INT
    int nFirstChar,   // INT
    int cChars   // INT
);
<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function EngComputeGlyphSet(
    nCodePage As Integer,   ' INT
    nFirstChar As Integer,   ' INT
    cChars As Integer   ' INT
) As IntPtr
End Function
' nCodePage : INT
' nFirstChar : INT
' cChars : INT
Declare PtrSafe Function EngComputeGlyphSet Lib "gdi32" ( _
    ByVal nCodePage As Long, _
    ByVal nFirstChar As Long, _
    ByVal cChars As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

EngComputeGlyphSet = ctypes.windll.gdi32.EngComputeGlyphSet
EngComputeGlyphSet.restype = ctypes.c_void_p
EngComputeGlyphSet.argtypes = [
    ctypes.c_int,  # nCodePage : INT
    ctypes.c_int,  # nFirstChar : INT
    ctypes.c_int,  # cChars : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('GDI32.dll')
EngComputeGlyphSet = Fiddle::Function.new(
  lib['EngComputeGlyphSet'],
  [
    Fiddle::TYPE_INT,  # nCodePage : INT
    Fiddle::TYPE_INT,  # nFirstChar : INT
    Fiddle::TYPE_INT,  # cChars : INT
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "gdi32")]
extern "system" {
    fn EngComputeGlyphSet(
        nCodePage: i32,  // INT
        nFirstChar: i32,  // INT
        cChars: i32  // INT
    ) -> *mut FD_GLYPHSET;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("GDI32.dll")]
public static extern IntPtr EngComputeGlyphSet(int nCodePage, int nFirstChar, int cChars);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_EngComputeGlyphSet' -Namespace Win32 -PassThru
# $api::EngComputeGlyphSet(nCodePage, nFirstChar, cChars)
#uselib "GDI32.dll"
#func global EngComputeGlyphSet "EngComputeGlyphSet" sptr, sptr, sptr
; EngComputeGlyphSet nCodePage, nFirstChar, cChars   ; 戻り値は stat
; nCodePage : INT -> "sptr"
; nFirstChar : INT -> "sptr"
; cChars : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "GDI32.dll"
#cfunc global EngComputeGlyphSet "EngComputeGlyphSet" int, int, int
; res = EngComputeGlyphSet(nCodePage, nFirstChar, cChars)
; nCodePage : INT -> "int"
; nFirstChar : INT -> "int"
; cChars : INT -> "int"
; FD_GLYPHSET* EngComputeGlyphSet(INT nCodePage, INT nFirstChar, INT cChars)
#uselib "GDI32.dll"
#cfunc global EngComputeGlyphSet "EngComputeGlyphSet" int, int, int
; res = EngComputeGlyphSet(nCodePage, nFirstChar, cChars)
; nCodePage : INT -> "int"
; nFirstChar : INT -> "int"
; cChars : INT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdi32 = windows.NewLazySystemDLL("GDI32.dll")
	procEngComputeGlyphSet = gdi32.NewProc("EngComputeGlyphSet")
)

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