ホーム › Graphics.Gdi › GCP_RESULTSA
GCP_RESULTSA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lStructSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| lpOutString | LPSTR | 8/4 | +8 | +4 | 整形後の出力文字列を受け取るANSIバッファへのポインタ。NULL可。 |
| lpOrder | DWORD* | 8/4 | +16 | +8 | 各文字の視覚的並び順インデックスを受け取る配列へのポインタ。NULL可。 |
| lpDx | INT* | 8/4 | +24 | +12 | 各文字の送り幅(セル幅)を受け取る配列へのポインタ。NULL可。 |
| lpCaretPos | INT* | 8/4 | +32 | +16 | 各文字のキャレット位置を受け取る配列へのポインタ。NULL可。 |
| lpClass | LPSTR | 8/4 | +40 | +20 | 各文字の分類(文字種別)を受け取るバッファへのポインタ。NULL可。 |
| lpGlyphs | LPWSTR | 8/4 | +48 | +24 | 各文字に対応するグリフインデックスを受け取るバッファへのポインタ。NULL可。 |
| nGlyphs | DWORD | 4 | +56 | +28 | lpGlyphsバッファのサイズ(要素数)。処理後に実際のグリフ数が返る。 |
| nMaxFit | INT | 4 | +60 | +32 | 指定幅に収まる文字数を受け取る。 |
各言語での定義
#include <windows.h>
// GCP_RESULTSA (x64 64 / x86 36 バイト)
typedef struct GCP_RESULTSA {
DWORD lStructSize;
LPSTR lpOutString;
DWORD* lpOrder;
INT* lpDx;
INT* lpCaretPos;
LPSTR lpClass;
LPWSTR lpGlyphs;
DWORD nGlyphs;
INT nMaxFit;
} GCP_RESULTSA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GCP_RESULTSA
{
public uint lStructSize;
public IntPtr lpOutString;
public IntPtr lpOrder;
public IntPtr lpDx;
public IntPtr lpCaretPos;
public IntPtr lpClass;
public IntPtr lpGlyphs;
public uint nGlyphs;
public int nMaxFit;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GCP_RESULTSA
Public lStructSize As UInteger
Public lpOutString As IntPtr
Public lpOrder As IntPtr
Public lpDx As IntPtr
Public lpCaretPos As IntPtr
Public lpClass As IntPtr
Public lpGlyphs As IntPtr
Public nGlyphs As UInteger
Public nMaxFit As Integer
End Structureimport ctypes
from ctypes import wintypes
class GCP_RESULTSA(ctypes.Structure):
_fields_ = [
("lStructSize", wintypes.DWORD),
("lpOutString", ctypes.c_void_p),
("lpOrder", ctypes.c_void_p),
("lpDx", ctypes.c_void_p),
("lpCaretPos", ctypes.c_void_p),
("lpClass", ctypes.c_void_p),
("lpGlyphs", ctypes.c_void_p),
("nGlyphs", wintypes.DWORD),
("nMaxFit", ctypes.c_int),
]#[repr(C)]
pub struct GCP_RESULTSA {
pub lStructSize: u32,
pub lpOutString: *mut core::ffi::c_void,
pub lpOrder: *mut core::ffi::c_void,
pub lpDx: *mut core::ffi::c_void,
pub lpCaretPos: *mut core::ffi::c_void,
pub lpClass: *mut core::ffi::c_void,
pub lpGlyphs: *mut core::ffi::c_void,
pub nGlyphs: u32,
pub nMaxFit: i32,
}import "golang.org/x/sys/windows"
type GCP_RESULTSA struct {
lStructSize uint32
lpOutString uintptr
lpOrder uintptr
lpDx uintptr
lpCaretPos uintptr
lpClass uintptr
lpGlyphs uintptr
nGlyphs uint32
nMaxFit int32
}type
GCP_RESULTSA = record
lStructSize: DWORD;
lpOutString: Pointer;
lpOrder: Pointer;
lpDx: Pointer;
lpCaretPos: Pointer;
lpClass: Pointer;
lpGlyphs: Pointer;
nGlyphs: DWORD;
nMaxFit: Integer;
end;const GCP_RESULTSA = extern struct {
lStructSize: u32,
lpOutString: ?*anyopaque,
lpOrder: ?*anyopaque,
lpDx: ?*anyopaque,
lpCaretPos: ?*anyopaque,
lpClass: ?*anyopaque,
lpGlyphs: ?*anyopaque,
nGlyphs: u32,
nMaxFit: i32,
};type
GCP_RESULTSA {.bycopy.} = object
lStructSize: uint32
lpOutString: pointer
lpOrder: pointer
lpDx: pointer
lpCaretPos: pointer
lpClass: pointer
lpGlyphs: pointer
nGlyphs: uint32
nMaxFit: int32struct GCP_RESULTSA
{
uint lStructSize;
void* lpOutString;
void* lpOrder;
void* lpDx;
void* lpCaretPos;
void* lpClass;
void* lpGlyphs;
uint nGlyphs;
int nMaxFit;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GCP_RESULTSA サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; lStructSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpOutString : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpOrder : DWORD* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpDx : INT* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpCaretPos : INT* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpClass : LPSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; lpGlyphs : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; nGlyphs : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; nMaxFit : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GCP_RESULTSA サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; lStructSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpOutString : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lpOrder : DWORD* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpDx : INT* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; lpCaretPos : INT* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; lpClass : LPSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; lpGlyphs : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; nGlyphs : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; nMaxFit : INT (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GCP_RESULTSA
#field int lStructSize
#field intptr lpOutString
#field intptr lpOrder
#field intptr lpDx
#field intptr lpCaretPos
#field intptr lpClass
#field intptr lpGlyphs
#field int nGlyphs
#field int nMaxFit
#endstruct
stdim st, GCP_RESULTSA ; NSTRUCT 変数を確保
st->lStructSize = 100
mes "lStructSize=" + st->lStructSize