ホーム › System.Mapi › MapiMessage
MapiMessage
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ulReserved | DWORD | 4 | +0 | +0 | 予約済みです。0 または CP_UTF8 でなければなりません。CP_UTF8 の場合、次のメンバーは ANSI 文字列ではなく UTF-8 文字列になります: lpszSubject、lpszNoteText、lpszMessageType、lpszDateReceived、lpszConversationID。 | ||||||||
| lpszSubject | LPSTR | 8/4 | +8 | +4 | メッセージの件名を表すテキスト文字列へのポインターです。通常は 256 文字以下に制限されます。このメンバーが空または NULL の場合、ユーザーは件名のテキストを入力していません。 | ||||||||
| lpszNoteText | LPSTR | 8/4 | +16 | +8 | メッセージ本文を格納する文字列へのポインターです。このメンバーが空または NULL の場合、メッセージ本文はありません。 | ||||||||
| lpszMessageType | LPSTR | 8/4 | +24 | +12 | IPM 以外の種類のメッセージを示す文字列へのポインターです。クライアントアプリケーションは、IPM 以外のメッセージに対して独自のメッセージの種類を選択できます。IPM メッセージのみをサポートするクライアントは、メッセージの読み取り時に lpszMessageType メンバーを無視し、メッセージの送信時には空または NULL を設定できます。 | ||||||||
| lpszDateReceived | LPSTR | 8/4 | +32 | +16 | メッセージを受信した日付を示す文字列へのポインターです。形式は YYYY/MM/DD HH:MM で、24 時間制を使用します。 | ||||||||
| lpszConversationID | LPSTR | 8/4 | +40 | +20 | メッセージが属する会話スレッドを識別する文字列へのポインターです。メッセージングシステムによっては、このメンバーを無視し、返さないことがあります。 | ||||||||
| flFlags | DWORD | 4 | +48 | +24 | メッセージの状態フラグのビットマスクです。次のフラグを設定できます。
| ||||||||
| lpOriginator | MapiRecipDesc* | 8/4 | +56 | +28 | メッセージの送信者に関する情報を格納する MapiRecipDesc 構造体へのポインターです。 | ||||||||
| nRecipCount | DWORD | 4 | +64 | +32 | lpRecips メンバーが指す配列に含まれる、メッセージ受信者の構造体の数です。値が 0 の場合、受信者は含まれていません。 | ||||||||
| lpRecips | MapiRecipDesc* | 8/4 | +72 | +36 | それぞれがメッセージ受信者に関する情報を格納する MapiRecipDesc 構造体の配列へのポインターです。 | ||||||||
| nFileCount | DWORD | 4 | +80 | +40 | lpFiles メンバーが指す配列に含まれる、ファイル添付を記述する構造体の数です。値が 0 の場合、ファイル添付は含まれていません。 | ||||||||
| lpFiles | MapiFileDesc* | 8/4 | +88 | +44 | それぞれがファイル添付に関する情報を格納する MapiFileDesc 構造体の配列へのポインターです。 |
公式ドキュメント
MapiMessage 構造体は、メッセージに関する情報を格納します。Unicode をサポートするには、MapiMessageW 構造体を使用します。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// MapiMessage (x64 96 / x86 48 バイト)
typedef struct MapiMessage {
DWORD ulReserved;
LPSTR lpszSubject;
LPSTR lpszNoteText;
LPSTR lpszMessageType;
LPSTR lpszDateReceived;
LPSTR lpszConversationID;
DWORD flFlags;
MapiRecipDesc* lpOriginator;
DWORD nRecipCount;
MapiRecipDesc* lpRecips;
DWORD nFileCount;
MapiFileDesc* lpFiles;
} MapiMessage;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MapiMessage
{
public uint ulReserved;
public IntPtr lpszSubject;
public IntPtr lpszNoteText;
public IntPtr lpszMessageType;
public IntPtr lpszDateReceived;
public IntPtr lpszConversationID;
public uint flFlags;
public IntPtr lpOriginator;
public uint nRecipCount;
public IntPtr lpRecips;
public uint nFileCount;
public IntPtr lpFiles;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MapiMessage
Public ulReserved As UInteger
Public lpszSubject As IntPtr
Public lpszNoteText As IntPtr
Public lpszMessageType As IntPtr
Public lpszDateReceived As IntPtr
Public lpszConversationID As IntPtr
Public flFlags As UInteger
Public lpOriginator As IntPtr
Public nRecipCount As UInteger
Public lpRecips As IntPtr
Public nFileCount As UInteger
Public lpFiles As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class MapiMessage(ctypes.Structure):
_fields_ = [
("ulReserved", wintypes.DWORD),
("lpszSubject", ctypes.c_void_p),
("lpszNoteText", ctypes.c_void_p),
("lpszMessageType", ctypes.c_void_p),
("lpszDateReceived", ctypes.c_void_p),
("lpszConversationID", ctypes.c_void_p),
("flFlags", wintypes.DWORD),
("lpOriginator", ctypes.c_void_p),
("nRecipCount", wintypes.DWORD),
("lpRecips", ctypes.c_void_p),
("nFileCount", wintypes.DWORD),
("lpFiles", ctypes.c_void_p),
]#[repr(C)]
pub struct MapiMessage {
pub ulReserved: u32,
pub lpszSubject: *mut core::ffi::c_void,
pub lpszNoteText: *mut core::ffi::c_void,
pub lpszMessageType: *mut core::ffi::c_void,
pub lpszDateReceived: *mut core::ffi::c_void,
pub lpszConversationID: *mut core::ffi::c_void,
pub flFlags: u32,
pub lpOriginator: *mut core::ffi::c_void,
pub nRecipCount: u32,
pub lpRecips: *mut core::ffi::c_void,
pub nFileCount: u32,
pub lpFiles: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type MapiMessage struct {
ulReserved uint32
lpszSubject uintptr
lpszNoteText uintptr
lpszMessageType uintptr
lpszDateReceived uintptr
lpszConversationID uintptr
flFlags uint32
lpOriginator uintptr
nRecipCount uint32
lpRecips uintptr
nFileCount uint32
lpFiles uintptr
}type
MapiMessage = record
ulReserved: DWORD;
lpszSubject: Pointer;
lpszNoteText: Pointer;
lpszMessageType: Pointer;
lpszDateReceived: Pointer;
lpszConversationID: Pointer;
flFlags: DWORD;
lpOriginator: Pointer;
nRecipCount: DWORD;
lpRecips: Pointer;
nFileCount: DWORD;
lpFiles: Pointer;
end;const MapiMessage = extern struct {
ulReserved: u32,
lpszSubject: ?*anyopaque,
lpszNoteText: ?*anyopaque,
lpszMessageType: ?*anyopaque,
lpszDateReceived: ?*anyopaque,
lpszConversationID: ?*anyopaque,
flFlags: u32,
lpOriginator: ?*anyopaque,
nRecipCount: u32,
lpRecips: ?*anyopaque,
nFileCount: u32,
lpFiles: ?*anyopaque,
};type
MapiMessage {.bycopy.} = object
ulReserved: uint32
lpszSubject: pointer
lpszNoteText: pointer
lpszMessageType: pointer
lpszDateReceived: pointer
lpszConversationID: pointer
flFlags: uint32
lpOriginator: pointer
nRecipCount: uint32
lpRecips: pointer
nFileCount: uint32
lpFiles: pointerstruct MapiMessage
{
uint ulReserved;
void* lpszSubject;
void* lpszNoteText;
void* lpszMessageType;
void* lpszDateReceived;
void* lpszConversationID;
uint flFlags;
void* lpOriginator;
uint nRecipCount;
void* lpRecips;
uint nFileCount;
void* lpFiles;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MapiMessage サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; ulReserved : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpszSubject : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpszNoteText : LPSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpszMessageType : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpszDateReceived : LPSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpszConversationID : LPSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; flFlags : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lpOriginator : MapiRecipDesc* (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; nRecipCount : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; lpRecips : MapiRecipDesc* (+36, 4byte) varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; nFileCount : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; lpFiles : MapiFileDesc* (+44, 4byte) varptr(st)+44 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MapiMessage サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; ulReserved : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpszSubject : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lpszNoteText : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpszMessageType : LPSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; lpszDateReceived : LPSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; lpszConversationID : LPSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; flFlags : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; lpOriginator : MapiRecipDesc* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; nRecipCount : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; lpRecips : MapiRecipDesc* (+72, 8byte) varptr(st)+72 を基点に操作(8byte:入れ子/配列)
; nFileCount : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; lpFiles : MapiFileDesc* (+88, 8byte) varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MapiMessage
#field int ulReserved
#field intptr lpszSubject
#field intptr lpszNoteText
#field intptr lpszMessageType
#field intptr lpszDateReceived
#field intptr lpszConversationID
#field int flFlags
#field intptr lpOriginator
#field int nRecipCount
#field intptr lpRecips
#field int nFileCount
#field intptr lpFiles
#endstruct
stdim st, MapiMessage ; NSTRUCT 変数を確保
st->ulReserved = 100
mes "ulReserved=" + st->ulReserved