ホーム › UI.Controls.RichEdit › GETTEXTEX
GETTEXTEX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| cb | DWORD | 4 | +0 | +0 | 取得したテキストを格納するために使用するバッファーのサイズ (バイト単位)。 | ||||||||||||
| flags | GETTEXTEX_FLAGS | 4 | +4 | +4 | テキスト操作を指定する値。このメンバーには次の値のいずれかを指定できます。
| ||||||||||||
| codepage | DWORD | 4 | +8 | +8 | 変換に使用されるコード ページ。ANSI コード ページの場合は CP_ACP、Unicode の場合は 1200 です。 | ||||||||||||
| lpDefaultChar | LPSTR | 8/4 | +16 | +12 | 指定されたコード ページでワイド文字を表現できない場合に使用される文字。これは、コード ページが 1200 (Unicode) でない場合にのみ使用されます。このメンバーが NULL の場合は、システム既定値が使用されます。 | ||||||||||||
| lpUsedDefChar | BOOL* | 8/4 | +24 | +16 | 既定文字 (lpDefaultChar) が使用されたかどうかを示すフラグ。このメンバーは、コード ページが 1200 または CP_UTF8 (Unicode) でない場合にのみ使用されます。ソース文字列内の 1 つ以上のワイド文字が指定されたコード ページで表現できない場合、フラグは TRUE になります。それ以外の場合、フラグは FALSE になります。このメンバーは NULL でもかまいません。 |
公式ドキュメント
リッチ エディット コントロールからテキストを取得する際に使用される情報を格納します。この構造体は EM_GETTEXTEX メッセージとともに使用されます。
解説(Remarks)
lpDefaultChar と lpUsedDefChar の両方が NULL の場合、EM_GETTEXTEX メッセージはより高速になります。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// GETTEXTEX (x64 32 / x86 20 バイト)
typedef struct GETTEXTEX {
DWORD cb;
GETTEXTEX_FLAGS flags;
DWORD codepage;
LPSTR lpDefaultChar;
BOOL* lpUsedDefChar;
} GETTEXTEX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GETTEXTEX
{
public uint cb;
public uint flags;
public uint codepage;
public IntPtr lpDefaultChar;
[MarshalAs(UnmanagedType.Bool)] public bool lpUsedDefChar;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GETTEXTEX
Public cb As UInteger
Public flags As UInteger
Public codepage As UInteger
Public lpDefaultChar As IntPtr
<MarshalAs(UnmanagedType.Bool)> Public lpUsedDefChar As Boolean
End Structureimport ctypes
from ctypes import wintypes
class GETTEXTEX(ctypes.Structure):
_fields_ = [
("cb", wintypes.DWORD),
("flags", wintypes.DWORD),
("codepage", wintypes.DWORD),
("lpDefaultChar", ctypes.c_void_p),
("lpUsedDefChar", ctypes.c_void_p),
]#[repr(C)]
pub struct GETTEXTEX {
pub cb: u32,
pub flags: u32,
pub codepage: u32,
pub lpDefaultChar: *mut core::ffi::c_void,
pub lpUsedDefChar: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type GETTEXTEX struct {
cb uint32
flags uint32
codepage uint32
lpDefaultChar uintptr
lpUsedDefChar uintptr
}type
GETTEXTEX = record
cb: DWORD;
flags: DWORD;
codepage: DWORD;
lpDefaultChar: Pointer;
lpUsedDefChar: Pointer;
end;const GETTEXTEX = extern struct {
cb: u32,
flags: u32,
codepage: u32,
lpDefaultChar: ?*anyopaque,
lpUsedDefChar: ?*anyopaque,
};type
GETTEXTEX {.bycopy.} = object
cb: uint32
flags: uint32
codepage: uint32
lpDefaultChar: pointer
lpUsedDefChar: pointerstruct GETTEXTEX
{
uint cb;
uint flags;
uint codepage;
void* lpDefaultChar;
void* lpUsedDefChar;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GETTEXTEX サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cb : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; flags : GETTEXTEX_FLAGS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; codepage : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpDefaultChar : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpUsedDefChar : BOOL* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GETTEXTEX サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cb : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; flags : GETTEXTEX_FLAGS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; codepage : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpDefaultChar : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpUsedDefChar : BOOL* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GETTEXTEX
#field int cb
#field int flags
#field int codepage
#field intptr lpDefaultChar
#field intptr lpUsedDefChar
#endstruct
stdim st, GETTEXTEX ; NSTRUCT 変数を確保
st->cb = 100
mes "cb=" + st->cb