Win32 API 日本語リファレンス
ホームSystem.AddressBook › DTBLEDIT

DTBLEDIT

構造体
サイズx64: 16 バイト / x86: 16 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
ulbLpszCharsAllowedDWORD4+0+0入力を許可する文字集合の文字列へのオフセット。
ulFlagsDWORD4+4+4エディットコントロールの動作フラグ。MAPI_UNICODE等を指定する。
ulNumCharsAllowedDWORD4+8+8入力可能な最大文字数。
ulPropTagDWORD4+12+12エディット内容と結び付けるプロパティのプロパティタグ。

各言語での定義

#include <windows.h>

// DTBLEDIT  (x64 16 / x86 16 バイト)
typedef struct DTBLEDIT {
    DWORD ulbLpszCharsAllowed;
    DWORD ulFlags;
    DWORD ulNumCharsAllowed;
    DWORD ulPropTag;
} DTBLEDIT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DTBLEDIT
{
    public uint ulbLpszCharsAllowed;
    public uint ulFlags;
    public uint ulNumCharsAllowed;
    public uint ulPropTag;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DTBLEDIT
    Public ulbLpszCharsAllowed As UInteger
    Public ulFlags As UInteger
    Public ulNumCharsAllowed As UInteger
    Public ulPropTag As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DTBLEDIT(ctypes.Structure):
    _fields_ = [
        ("ulbLpszCharsAllowed", wintypes.DWORD),
        ("ulFlags", wintypes.DWORD),
        ("ulNumCharsAllowed", wintypes.DWORD),
        ("ulPropTag", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DTBLEDIT {
    pub ulbLpszCharsAllowed: u32,
    pub ulFlags: u32,
    pub ulNumCharsAllowed: u32,
    pub ulPropTag: u32,
}
import "golang.org/x/sys/windows"

type DTBLEDIT struct {
	ulbLpszCharsAllowed uint32
	ulFlags uint32
	ulNumCharsAllowed uint32
	ulPropTag uint32
}
type
  DTBLEDIT = record
    ulbLpszCharsAllowed: DWORD;
    ulFlags: DWORD;
    ulNumCharsAllowed: DWORD;
    ulPropTag: DWORD;
  end;
const DTBLEDIT = extern struct {
    ulbLpszCharsAllowed: u32,
    ulFlags: u32,
    ulNumCharsAllowed: u32,
    ulPropTag: u32,
};
type
  DTBLEDIT {.bycopy.} = object
    ulbLpszCharsAllowed: uint32
    ulFlags: uint32
    ulNumCharsAllowed: uint32
    ulPropTag: uint32
struct DTBLEDIT
{
    uint ulbLpszCharsAllowed;
    uint ulFlags;
    uint ulNumCharsAllowed;
    uint ulPropTag;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DTBLEDIT サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; ulbLpszCharsAllowed : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ulFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ulNumCharsAllowed : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ulPropTag : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DTBLEDIT
    #field int ulbLpszCharsAllowed
    #field int ulFlags
    #field int ulNumCharsAllowed
    #field int ulPropTag
#endstruct

stdim st, DTBLEDIT        ; NSTRUCT 変数を確保
st->ulbLpszCharsAllowed = 100
mes "ulbLpszCharsAllowed=" + st->ulbLpszCharsAllowed