ホーム › UI.Controls › DTTOPTS
DTTOPTS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 構造体のサイズです。 | ||||||||||||||||||||||||||||||||
| dwFlags | DTTOPTS_FLAGS | 4 | +4 | +4 | DTTOPTS 構造体の特定の値が指定されているかどうか、およびそれらの値をどのように解釈するかを指定するフラグの組み合わせです。このメンバーには次の値の組み合わせを指定できます。
| ||||||||||||||||||||||||||||||||
| crText | COLORREF | 4 | +8 | +8 | 描画されるテキストの色を指定します。 | ||||||||||||||||||||||||||||||||
| crBorder | COLORREF | 4 | +12 | +12 | テキストの周囲に描画されるアウトラインの色を指定します。 | ||||||||||||||||||||||||||||||||
| crShadow | COLORREF | 4 | +16 | +16 | テキストの背後に描画される影の色を指定します。 | ||||||||||||||||||||||||||||||||
| iTextShadowType | INT | 4 | +20 | +20 | テキストの背後に描画される影の種類を指定します。このメンバーには次のいずれかの値を指定できます。
| ||||||||||||||||||||||||||||||||
| ptShadowOffset | POINT | 8 | +24 | +24 | 影とテキストの間のオフセット量を論理座標で指定します。 | ||||||||||||||||||||||||||||||||
| iBorderSize | INT | 4 | +32 | +32 | テキストの周囲に描画されるアウトラインの半径を指定します。 | ||||||||||||||||||||||||||||||||
| iFontPropId | INT | 4 | +36 | +36 | テキストの描画時に使用する代替のフォントプロパティを指定します。指定できる値の一覧については、GetThemeSysFont を参照してください。 | ||||||||||||||||||||||||||||||||
| iColorPropId | INT | 4 | +40 | +40 | テキストの描画時に使用する代替の色プロパティを指定します。この値が有効で、対応するフラグが dwFlags に設定されている場合、この値は crText の値より優先されます。指定できる値については、GetSysColor の nIndex パラメーターに挙げられている値を参照してください。 | ||||||||||||||||||||||||||||||||
| iStateId | INT | 4 | +44 | +44 | 使用する代替の状態を指定します。このメンバーは DrawThemeTextEx では使用されません。 | ||||||||||||||||||||||||||||||||
| fApplyOverlay | BOOL | 4 | +48 | +48 | TRUE の場合、影とアウトラインの効果の上にテキストが描画されます。FALSE の場合、影とアウトラインの効果だけが描画されます。 | ||||||||||||||||||||||||||||||||
| iGlowSize | INT | 4 | +52 | +52 | テキストが描画される前に背景に描画されるグローのサイズを指定します。 | ||||||||||||||||||||||||||||||||
| pfnDrawTextCallback | DTT_CALLBACK_PROC | 8/4 | +56 | +56 | DrawThemeTextEx のコールバック関数へのポインターです。 | ||||||||||||||||||||||||||||||||
| lParam | LPARAM | 8/4 | +64 | +60 | pfnDrawTextCallback で指定されたコールバック関数に渡されるパラメーターです。 |
公式ドキュメント
DrawThemeTextEx 関数のオプションを定義します。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// POINT (x64 8 / x86 8 バイト)
typedef struct POINT {
INT x;
INT y;
} POINT;
// DTTOPTS (x64 72 / x86 64 バイト)
typedef struct DTTOPTS {
DWORD dwSize;
DTTOPTS_FLAGS dwFlags;
COLORREF crText;
COLORREF crBorder;
COLORREF crShadow;
INT iTextShadowType;
POINT ptShadowOffset;
INT iBorderSize;
INT iFontPropId;
INT iColorPropId;
INT iStateId;
BOOL fApplyOverlay;
INT iGlowSize;
DTT_CALLBACK_PROC pfnDrawTextCallback;
LPARAM lParam;
} DTTOPTS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DTTOPTS
{
public uint dwSize;
public uint dwFlags;
public uint crText;
public uint crBorder;
public uint crShadow;
public int iTextShadowType;
public POINT ptShadowOffset;
public int iBorderSize;
public int iFontPropId;
public int iColorPropId;
public int iStateId;
[MarshalAs(UnmanagedType.Bool)] public bool fApplyOverlay;
public int iGlowSize;
public IntPtr pfnDrawTextCallback;
public IntPtr lParam;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
Public x As Integer
Public y As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DTTOPTS
Public dwSize As UInteger
Public dwFlags As UInteger
Public crText As UInteger
Public crBorder As UInteger
Public crShadow As UInteger
Public iTextShadowType As Integer
Public ptShadowOffset As POINT
Public iBorderSize As Integer
Public iFontPropId As Integer
Public iColorPropId As Integer
Public iStateId As Integer
<MarshalAs(UnmanagedType.Bool)> Public fApplyOverlay As Boolean
Public iGlowSize As Integer
Public pfnDrawTextCallback As IntPtr
Public lParam As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class POINT(ctypes.Structure):
_fields_ = [
("x", ctypes.c_int),
("y", ctypes.c_int),
]
class DTTOPTS(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("crText", wintypes.DWORD),
("crBorder", wintypes.DWORD),
("crShadow", wintypes.DWORD),
("iTextShadowType", ctypes.c_int),
("ptShadowOffset", POINT),
("iBorderSize", ctypes.c_int),
("iFontPropId", ctypes.c_int),
("iColorPropId", ctypes.c_int),
("iStateId", ctypes.c_int),
("fApplyOverlay", wintypes.BOOL),
("iGlowSize", ctypes.c_int),
("pfnDrawTextCallback", ctypes.c_void_p),
("lParam", ctypes.c_ssize_t),
]#[repr(C)]
pub struct POINT {
pub x: i32,
pub y: i32,
}
#[repr(C)]
pub struct DTTOPTS {
pub dwSize: u32,
pub dwFlags: u32,
pub crText: u32,
pub crBorder: u32,
pub crShadow: u32,
pub iTextShadowType: i32,
pub ptShadowOffset: POINT,
pub iBorderSize: i32,
pub iFontPropId: i32,
pub iColorPropId: i32,
pub iStateId: i32,
pub fApplyOverlay: i32,
pub iGlowSize: i32,
pub pfnDrawTextCallback: *mut core::ffi::c_void,
pub lParam: isize,
}import "golang.org/x/sys/windows"
type POINT struct {
x int32
y int32
}
type DTTOPTS struct {
dwSize uint32
dwFlags uint32
crText uint32
crBorder uint32
crShadow uint32
iTextShadowType int32
ptShadowOffset POINT
iBorderSize int32
iFontPropId int32
iColorPropId int32
iStateId int32
fApplyOverlay int32
iGlowSize int32
pfnDrawTextCallback uintptr
lParam uintptr
}type
POINT = record
x: Integer;
y: Integer;
end;
DTTOPTS = record
dwSize: DWORD;
dwFlags: DWORD;
crText: DWORD;
crBorder: DWORD;
crShadow: DWORD;
iTextShadowType: Integer;
ptShadowOffset: POINT;
iBorderSize: Integer;
iFontPropId: Integer;
iColorPropId: Integer;
iStateId: Integer;
fApplyOverlay: BOOL;
iGlowSize: Integer;
pfnDrawTextCallback: Pointer;
lParam: NativeInt;
end;const POINT = extern struct {
x: i32,
y: i32,
};
const DTTOPTS = extern struct {
dwSize: u32,
dwFlags: u32,
crText: u32,
crBorder: u32,
crShadow: u32,
iTextShadowType: i32,
ptShadowOffset: POINT,
iBorderSize: i32,
iFontPropId: i32,
iColorPropId: i32,
iStateId: i32,
fApplyOverlay: i32,
iGlowSize: i32,
pfnDrawTextCallback: ?*anyopaque,
lParam: isize,
};type
POINT {.bycopy.} = object
x: int32
y: int32
DTTOPTS {.bycopy.} = object
dwSize: uint32
dwFlags: uint32
crText: uint32
crBorder: uint32
crShadow: uint32
iTextShadowType: int32
ptShadowOffset: POINT
iBorderSize: int32
iFontPropId: int32
iColorPropId: int32
iStateId: int32
fApplyOverlay: int32
iGlowSize: int32
pfnDrawTextCallback: pointer
lParam: intstruct POINT
{
int x;
int y;
}
struct DTTOPTS
{
uint dwSize;
uint dwFlags;
uint crText;
uint crBorder;
uint crShadow;
int iTextShadowType;
POINT ptShadowOffset;
int iBorderSize;
int iFontPropId;
int iColorPropId;
int iStateId;
int fApplyOverlay;
int iGlowSize;
void* pfnDrawTextCallback;
ptrdiff_t lParam;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DTTOPTS サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DTTOPTS_FLAGS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; crText : COLORREF (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; crBorder : COLORREF (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; crShadow : COLORREF (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; iTextShadowType : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ptShadowOffset : POINT (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; iBorderSize : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; iFontPropId : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; iColorPropId : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; iStateId : INT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; fApplyOverlay : BOOL (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; iGlowSize : INT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; pfnDrawTextCallback : DTT_CALLBACK_PROC (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; lParam : LPARAM (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DTTOPTS サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DTTOPTS_FLAGS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; crText : COLORREF (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; crBorder : COLORREF (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; crShadow : COLORREF (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; iTextShadowType : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ptShadowOffset : POINT (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; iBorderSize : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; iFontPropId : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; iColorPropId : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; iStateId : INT (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; fApplyOverlay : BOOL (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; iGlowSize : INT (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; pfnDrawTextCallback : DTT_CALLBACK_PROC (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; lParam : LPARAM (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINT
#field int x
#field int y
#endstruct
#defstruct global DTTOPTS
#field int dwSize
#field int dwFlags
#field int crText
#field int crBorder
#field int crShadow
#field int iTextShadowType
#field POINT ptShadowOffset
#field int iBorderSize
#field int iFontPropId
#field int iColorPropId
#field int iStateId
#field bool fApplyOverlay
#field int iGlowSize
#field intptr pfnDrawTextCallback
#field intptr lParam
#endstruct
stdim st, DTTOPTS ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize