DTCTL
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ulCtlType | DWORD | 4 | +0 | +0 | 表示テーブルコントロールの種別。DTCT_LABEL/EDIT/LBX等を指定する。 |
| ulCtlFlags | DWORD | 4 | +4 | +4 | コントロール全般の動作フラグ。DT_REQUIRED/EDITABLE等を組み合わせる。 |
| lpbNotif | BYTE* | 8/4 | +8 | +8 | コントロールの変更通知に使うバイナリデータへのポインタ。 |
| cbNotif | DWORD | 4 | +16 | +12 | lpbNotifが指す通知データのバイト長。 |
| lpszFilter | CHAR* | 8/4 | +24 | +16 | コントロールに適用する入力フィルタ文字列へのポインタ。NULL可。 |
| ulItemID | DWORD | 4 | +32 | +20 | ダイアログテンプレート内でこのコントロールを識別するアイテムID。 |
| ctl | _ctl_e__Union | 8/4 | +40 | +24 | ulCtlTypeに応じて有効なメンバが変わるコントロール固有データの共用体。 |
共用体: _ctl_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| lpv | void* | 8/4 | +0 | +0 |
| lplabel | DTBLLABEL* | 8/4 | +0 | +0 |
| lpedit | DTBLEDIT* | 8/4 | +0 | +0 |
| lplbx | DTBLLBX* | 8/4 | +0 | +0 |
| lpcombobox | DTBLCOMBOBOX* | 8/4 | +0 | +0 |
| lpddlbx | DTBLDDLBX* | 8/4 | +0 | +0 |
| lpcheckbox | DTBLCHECKBOX* | 8/4 | +0 | +0 |
| lpgroupbox | DTBLGROUPBOX* | 8/4 | +0 | +0 |
| lpbutton | DTBLBUTTON* | 8/4 | +0 | +0 |
| lpradiobutton | DTBLRADIOBUTTON* | 8/4 | +0 | +0 |
| lpmvlbx | DTBLMVLISTBOX* | 8/4 | +0 | +0 |
| lpmvddlbx | DTBLMVDDLBX* | 8/4 | +0 | +0 |
| lppage | DTBLPAGE* | 8/4 | +0 | +0 |
公式ドキュメント
適用対象: Outlook 2013 | Outlook 2016
表示テーブルから構築されるダイアログ ボックスで使用されるコントロールを記述します。
| プロパティ | 値 |
|---|---|
| ヘッダー ファイル: |
Mapidefs.h |
typedef struct
{
ULONG ulCtlType;
ULONG ulCtlFlags;
LPBYTE lpbNotif;
ULONG cbNotif;
LPSTR lpszFilter;
ULONG ulItemID;
union
{
LPVOID lpv;
LPDTBLLABEL lplabel;
LPDTBLEDIT lpedit;
LPDTBLLBX lplbx;
LPDTBLCOMBOBOX lpcombobox;
LPDTBLDDLBX lpddlbx;
LPDTBLCHECKBOX lpcheckbox;
LPDTBLGROUPBOX lpgroupbox;
LPDTBLBUTTON lpbutton;
LPDTBLRADIOBUTTON lpradiobutton;
LPDTBLMVLISTBOX lpmvlbx;
LPDTBLMVDDLBX lpmvddlbx;
LPDTBLPAGE lppage;
} ctl;
} DTCTL, FAR *LPDTCTL;
解説(Remarks)
DTCTL 構造体は、任意の種類のコントロールを 1 つ記述します。そのメンバーのほとんどは、コントロールのプロパティを設定するために使用されます。
ctl メンバーは、特定の種類のコントロールに関連する構造体の共用体です。たとえば、DTCTL 構造体が編集コントロールを記述している場合、ctl メンバーは DTBLEDIT 構造体を指します。この構造体は、コントロールの PR_CONTROL_STRUCTURE プロパティに対応します。この共用体は、DTCTL 構造体のコンパイル時の初期化を可能にするため、最初のメンバーとして LPVOID 型の変数を持ちます。
BuildDisplayTable 関数はコントロール リソースから表示テーブルを構築する際に DTCTL 構造体を使用しますが、DTCTL 構造体自体が表示テーブルに現れることはありません。この構造体は BuildDisplayTable に情報を提供するだけです。
ulCtlFlags メンバーでは、DT_ACCEPT_DBCS、DT_EDITABLE、DT_MULTILINE、DT_PASSWORD_EDIT の 4 つのフラグが編集コントロールにのみ影響します。他の 2 つ、DT_REQUIRED と DT_SET_IMMEDIATE は、編集可能なすべてのコントロールに影響します。
ダイアログ ボックスで使用できるコントロールは、ラベル、テキスト ボックス、インク対応テキスト ボックス、リスト、ドロップダウン リスト、コンボ ボックス、チェック ボックス、グループ ボックス、ボタン、ラジオ ボタン、およびタブ ページです。
表示テーブルの概要については、「Display Tables」を参照してください。表示テーブルの実装方法については、「Implementing a Display Table」を参照してください。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp)
各言語での定義
#include <windows.h>
// DTCTL (x64 48 / x86 28 バイト)
typedef struct DTCTL {
DWORD ulCtlType;
DWORD ulCtlFlags;
BYTE* lpbNotif;
DWORD cbNotif;
CHAR* lpszFilter;
DWORD ulItemID;
_ctl_e__Union ctl;
} DTCTL;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DTCTL
{
public uint ulCtlType;
public uint ulCtlFlags;
public IntPtr lpbNotif;
public uint cbNotif;
public IntPtr lpszFilter;
public uint ulItemID;
public _ctl_e__Union ctl;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DTCTL
Public ulCtlType As UInteger
Public ulCtlFlags As UInteger
Public lpbNotif As IntPtr
Public cbNotif As UInteger
Public lpszFilter As IntPtr
Public ulItemID As UInteger
Public ctl As _ctl_e__Union
End Structureimport ctypes
from ctypes import wintypes
class DTCTL(ctypes.Structure):
_fields_ = [
("ulCtlType", wintypes.DWORD),
("ulCtlFlags", wintypes.DWORD),
("lpbNotif", ctypes.c_void_p),
("cbNotif", wintypes.DWORD),
("lpszFilter", ctypes.c_void_p),
("ulItemID", wintypes.DWORD),
("ctl", _ctl_e__Union),
]#[repr(C)]
pub struct DTCTL {
pub ulCtlType: u32,
pub ulCtlFlags: u32,
pub lpbNotif: *mut core::ffi::c_void,
pub cbNotif: u32,
pub lpszFilter: *mut core::ffi::c_void,
pub ulItemID: u32,
pub ctl: _ctl_e__Union,
}import "golang.org/x/sys/windows"
type DTCTL struct {
ulCtlType uint32
ulCtlFlags uint32
lpbNotif uintptr
cbNotif uint32
lpszFilter uintptr
ulItemID uint32
ctl _ctl_e__Union
}type
DTCTL = record
ulCtlType: DWORD;
ulCtlFlags: DWORD;
lpbNotif: Pointer;
cbNotif: DWORD;
lpszFilter: Pointer;
ulItemID: DWORD;
ctl: _ctl_e__Union;
end;const DTCTL = extern struct {
ulCtlType: u32,
ulCtlFlags: u32,
lpbNotif: ?*anyopaque,
cbNotif: u32,
lpszFilter: ?*anyopaque,
ulItemID: u32,
ctl: _ctl_e__Union,
};type
DTCTL {.bycopy.} = object
ulCtlType: uint32
ulCtlFlags: uint32
lpbNotif: pointer
cbNotif: uint32
lpszFilter: pointer
ulItemID: uint32
ctl: _ctl_e__Unionstruct DTCTL
{
uint ulCtlType;
uint ulCtlFlags;
void* lpbNotif;
uint cbNotif;
void* lpszFilter;
uint ulItemID;
_ctl_e__Union ctl;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DTCTL サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; ulCtlType : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ulCtlFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpbNotif : BYTE* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cbNotif : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpszFilter : CHAR* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ulItemID : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ctl : _ctl_e__Union (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DTCTL サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; ulCtlType : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ulCtlFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpbNotif : BYTE* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cbNotif : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpszFilter : CHAR* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ulItemID : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ctl : _ctl_e__Union (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DTCTL
#field int ulCtlType
#field int ulCtlFlags
#field intptr lpbNotif
#field int cbNotif
#field intptr lpszFilter
#field int ulItemID
#field byte ctl 8
#endstruct
stdim st, DTCTL ; NSTRUCT 変数を確保
st->ulCtlType = 100
mes "ulCtlType=" + st->ulCtlType
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。