1 module win32.ddeml;
2
3 // Translated from Microsoft Platform SDK August 2001 Edition
4 // by Y.Tomino
5
6 import win32.windef;
7
8 // #ifndef _INC_DDEMLH
9 // #define _INC_DDEMLH
10
11 // #ifdef __cplusplus
12 // extern "C" {
13 // #endif /* __cplusplus */
14
15 alias void* HCONVLIST;
16 alias void* HCONV;
17 alias void* HSZ;
18 alias void* HDDEDATA;
19 // #define EXPENTRY CALLBACK
20
21 struct tagHSZPAIR {
22 HSZ hszSvc;
23 HSZ hszTopic;
24 }
25 alias tagHSZPAIR HSZPAIR;
26
27 alias HSZPAIR* PHSZPAIR;
28
29 struct tagCONVCONTEXT {
30 UINT cb;
31 UINT wFlags;
32 UINT wCountryID;
33 int iCodePage;
34 DWORD dwLangID;
35 DWORD dwSecurity;
36 SECURITY_QUALITY_OF_SERVICE qos;
37 }
38 alias tagCONVCONTEXT CONVCONTEXT;
39
40 alias CONVCONTEXT* PCONVCONTEXT;
41
42 struct tagCONVINFO {
43 DWORD cb;
44 DWORD_PTR hUser;
45 HCONV hConvPartner;
46 HSZ hszSvcPartner;
47 HSZ hszServiceReq;
48 HSZ hszTopic;
49 HSZ hszItem;
50 UINT wFmt;
51 UINT wType;
52 UINT wStatus;
53 UINT wConvst;
54 UINT wLastError;
55 HCONVLIST hConvList;
56 CONVCONTEXT ConvCtxt;
57 HWND hwnd;
58 HWND hwndPartner;
59 }
60 alias tagCONVINFO CONVINFO;
61
62 alias CONVINFO* PCONVINFO;
63
64 enum : uint { XST_NULL = 0 }
65 enum : uint { XST_INCOMPLETE = 1 }
66 enum : uint { XST_CONNECTED = 2 }
67 enum : uint { XST_INIT1 = 3 }
68 enum : uint { XST_INIT2 = 4 }
69 enum : uint { XST_REQSENT = 5 }
70 enum : uint { XST_DATARCVD = 6 }
71 enum : uint { XST_POKESENT = 7 }
72 enum : uint { XST_POKEACKRCVD = 8 }
73 enum : uint { XST_EXECSENT = 9 }
74 enum : uint { XST_EXECACKRCVD = 10 }
75 enum : uint { XST_ADVSENT = 11 }
76 enum : uint { XST_UNADVSENT = 12 }
77 enum : uint { XST_ADVACKRCVD = 13 }
78 enum : uint { XST_UNADVACKRCVD = 14 }
79 enum : uint { XST_ADVDATASENT = 15 }
80 enum : uint { XST_ADVDATAACKRCVD = 16 }
81
82 enum : uint { CADV_LATEACK = 0xFFFF }
83
84 enum : uint { ST_CONNECTED = 0x0001 }
85 enum : uint { ST_ADVISE = 0x0002 }
86 enum : uint { ST_ISLOCAL = 0x0004 }
87 enum : uint { ST_BLOCKED = 0x0008 }
88 enum : uint { ST_CLIENT = 0x0010 }
89 enum : uint { ST_TERMINATED = 0x0020 }
90 enum : uint { ST_INLIST = 0x0040 }
91 enum : uint { ST_BLOCKNEXT = 0x0080 }
92 enum : uint { ST_ISSELF = 0x0100 }
93
94 enum : uint { DDE_FACK = 0x8000 }
95 enum : uint { DDE_FBUSY = 0x4000 }
96 enum : uint { DDE_FDEFERUPD = 0x4000 }
97 enum : uint { DDE_FACKREQ = 0x8000 }
98 enum : uint { DDE_FRELEASE = 0x2000 }
99 enum : uint { DDE_FREQUESTED = 0x1000 }
100 enum : uint { DDE_FAPPSTATUS = 0x00ff }
101 enum : uint { DDE_FNOTPROCESSED = 0x0000 }
102
103 const uint DDE_FACKRESERVED = ~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS);
104 const uint DDE_FADVRESERVED = ~(DDE_FACKREQ | DDE_FDEFERUPD);
105 const uint DDE_FDATRESERVED = ~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED);
106 const uint DDE_FPOKRESERVED = ~(DDE_FRELEASE);
107
108 enum : uint { MSGF_DDEMGR = 0x8001 }
109
110 enum : uint { CP_WINANSI = 1004 }
111 enum : uint { CP_WINUNICODE = 1200 }
112 // #ifdef UNICODE
113 alias CP_WINUNICODE CP_WINNEUTRAL;
114 // #else // !UNICODE
115 // #...
116 // #endif // !UNICODE
117
118 enum : uint { XTYPF_NOBLOCK = 0x0002 }
119 enum : uint { XTYPF_NODATA = 0x0004 }
120 enum : uint { XTYPF_ACKREQ = 0x0008 }
121
122 enum : uint { XCLASS_MASK = 0xFC00 }
123 enum : uint { XCLASS_BOOL = 0x1000 }
124 enum : uint { XCLASS_DATA = 0x2000 }
125 enum : uint { XCLASS_FLAGS = 0x4000 }
126 enum : uint { XCLASS_NOTIFICATION = 0x8000 }
127
128 const uint XTYP_ERROR = 0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK ;
129 const uint XTYP_ADVDATA = 0x0010 | XCLASS_FLAGS ;
130 const uint XTYP_ADVREQ = 0x0020 | XCLASS_DATA | XTYPF_NOBLOCK ;
131 const uint XTYP_ADVSTART = 0x0030 | XCLASS_BOOL ;
132 const uint XTYP_ADVSTOP = 0x0040 | XCLASS_NOTIFICATION;
133 const uint XTYP_EXECUTE = 0x0050 | XCLASS_FLAGS ;
134 const uint XTYP_CONNECT = 0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK;
135 const uint XTYP_CONNECT_CONFIRM = 0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK;
136 const uint XTYP_XACT_COMPLETE = 0x0080 | XCLASS_NOTIFICATION ;
137 const uint XTYP_POKE = 0x0090 | XCLASS_FLAGS ;
138 const uint XTYP_REGISTER = 0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK;
139 const uint XTYP_REQUEST = 0x00B0 | XCLASS_DATA ;
140 const uint XTYP_DISCONNECT = 0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK;
141 const uint XTYP_UNREGISTER = 0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK;
142 const uint XTYP_WILDCONNECT = 0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK;
143
144 enum : uint { XTYP_MASK = 0x00F0 }
145 enum : uint { XTYP_SHIFT = 4 }
146
147 enum : uint { TIMEOUT_ASYNC = 0xFFFFFFFF }
148
149 enum : uint { QID_SYNC = 0xFFFFFFFF }
150
151 // #ifdef UNICODE
152 const wchar[] SZDDESYS_TOPIC = "System";
153 const wchar[] SZDDESYS_ITEM_TOPICS = "Topics";
154 const wchar[] SZDDESYS_ITEM_SYSITEMS = "SysItems";
155 const wchar[] SZDDESYS_ITEM_RTNMSG = "ReturnMessage";
156 const wchar[] SZDDESYS_ITEM_STATUS = "Status";
157 const wchar[] SZDDESYS_ITEM_FORMATS = "Formats";
158 const wchar[] SZDDESYS_ITEM_HELP = "Help";
159 const wchar[] SZDDE_ITEM_ITEMLIST = "TopicItemList";
160 // #else
161 // #...
162 // #...
163 // #...
164 // #...
165 // #...
166 // #...
167 // #...
168 // #...
169 // #endif
170
171 // typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG_PTR dwData1, ULONG_PTR dwData2);
172 extern(Windows) alias HDDEDATA function(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG_PTR dwData1, ULONG_PTR dwData2) PFNCALLBACK;
173
174 const HDDEDATA CBR_BLOCK = cast(HDDEDATA)-1;
175
176 extern(Windows) export UINT DdeInitializeA( LPDWORD pidInst, PFNCALLBACK pfnCallback,
177 DWORD afCmd, DWORD ulRes);
178 extern(Windows) export UINT DdeInitializeW( LPDWORD pidInst, PFNCALLBACK pfnCallback,
179 DWORD afCmd, DWORD ulRes);
180 // #ifdef UNICODE
181 alias DdeInitializeW DdeInitialize;
182 // #else
183 // #...
184 // #endif // !UNICODE
185
186 enum : uint { CBF_FAIL_SELFCONNECTIONS = 0x00001000 }
187 enum : uint { CBF_FAIL_CONNECTIONS = 0x00002000 }
188 enum : uint { CBF_FAIL_ADVISES = 0x00004000 }
189 enum : uint { CBF_FAIL_EXECUTES = 0x00008000 }
190 enum : uint { CBF_FAIL_POKES = 0x00010000 }
191 enum : uint { CBF_FAIL_REQUESTS = 0x00020000 }
192 enum : uint { CBF_FAIL_ALLSVRXACTIONS = 0x0003f000 }
193
194 enum : uint { CBF_SKIP_CONNECT_CONFIRMS = 0x00040000 }
195 enum : uint { CBF_SKIP_REGISTRATIONS = 0x00080000 }
196 enum : uint { CBF_SKIP_UNREGISTRATIONS = 0x00100000 }
197 enum : uint { CBF_SKIP_DISCONNECTS = 0x00200000 }
198 enum : uint { CBF_SKIP_ALLNOTIFICATIONS = 0x003c0000 }
199
200 enum : uint { APPCMD_CLIENTONLY = 0x00000010 }
201 enum : uint { APPCMD_FILTERINITS = 0x00000020 }
202 enum : uint { APPCMD_MASK = 0x00000FF0 }
203
204 enum : uint { APPCLASS_STANDARD = 0x00000000 }
205 enum : uint { APPCLASS_MASK = 0x0000000F }
206
207 extern(Windows) export BOOL DdeUninitialize( DWORD idInst);
208
209 extern(Windows) export HCONVLIST DdeConnectList( DWORD idInst, HSZ hszService, HSZ hszTopic,
210 HCONVLIST hConvList, PCONVCONTEXT pCC);
211 extern(Windows) export HCONV DdeQueryNextServer( HCONVLIST hConvList, HCONV hConvPrev);
212 extern(Windows) export BOOL DdeDisconnectList( HCONVLIST hConvList);
213
214 extern(Windows) export HCONV DdeConnect( DWORD idInst, HSZ hszService, HSZ hszTopic,
215 PCONVCONTEXT pCC);
216 extern(Windows) export BOOL DdeDisconnect( HCONV hConv);
217 extern(Windows) export HCONV DdeReconnect( HCONV hConv);
218 extern(Windows) export UINT DdeQueryConvInfo( HCONV hConv, DWORD idTransaction, PCONVINFO pConvInfo);
219 extern(Windows) export BOOL DdeSetUserHandle( HCONV hConv, DWORD id, DWORD_PTR hUser);
220 extern(Windows) export BOOL DdeAbandonTransaction( DWORD idInst, HCONV hConv, DWORD idTransaction);
221
222 extern(Windows) export BOOL DdePostAdvise( DWORD idInst, HSZ hszTopic, HSZ hszItem);
223 extern(Windows) export BOOL DdeEnableCallback( DWORD idInst, HCONV hConv, UINT wCmd);
224 extern(Windows) export BOOL DdeImpersonateClient( HCONV hConv);
225
226 enum : uint { EC_ENABLEALL = 0 }
227 alias ST_BLOCKNEXT EC_ENABLEONE;
228 alias ST_BLOCKED EC_DISABLE;
229 enum : uint { EC_QUERYWAITING = 2 }
230
231 extern(Windows) export HDDEDATA DdeNameService( DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd);
232
233 enum : uint { DNS_REGISTER = 0x0001 }
234 enum : uint { DNS_UNREGISTER = 0x0002 }
235 enum : uint { DNS_FILTERON = 0x0004 }
236 enum : uint { DNS_FILTEROFF = 0x0008 }
237
238 extern(Windows) export HDDEDATA DdeClientTransaction( LPBYTE pData, DWORD cbData,
239 HCONV hConv, HSZ hszItem, UINT wFmt, UINT wType,
240 DWORD dwTimeout, LPDWORD pdwResult);
241
242 extern(Windows) export HDDEDATA DdeCreateDataHandle( DWORD idInst, LPBYTE pSrc, DWORD cb,
243 DWORD cbOff, HSZ hszItem, UINT wFmt, UINT afCmd);
244 extern(Windows) export HDDEDATA DdeAddData( HDDEDATA hData, LPBYTE pSrc, DWORD cb, DWORD cbOff);
245 extern(Windows) export DWORD DdeGetData( HDDEDATA hData, LPBYTE pDst, DWORD cbMax, DWORD cbOff);
246 extern(Windows) export LPBYTE DdeAccessData( HDDEDATA hData, LPDWORD pcbDataSize);
247 extern(Windows) export BOOL DdeUnaccessData( HDDEDATA hData);
248 extern(Windows) export BOOL DdeFreeDataHandle( HDDEDATA hData);
249
250 enum : uint { HDATA_APPOWNED = 0x0001 }
251
252 extern(Windows) export UINT DdeGetLastError( DWORD idInst);
253
254 enum : uint { DMLERR_NO_ERROR = 0 }
255
256 enum : uint { DMLERR_FIRST = 0x4000 }
257
258 enum : uint { DMLERR_ADVACKTIMEOUT = 0x4000 }
259 enum : uint { DMLERR_BUSY = 0x4001 }
260 enum : uint { DMLERR_DATAACKTIMEOUT = 0x4002 }
261 enum : uint { DMLERR_DLL_NOT_INITIALIZED = 0x4003 }
262 enum : uint { DMLERR_DLL_USAGE = 0x4004 }
263 enum : uint { DMLERR_EXECACKTIMEOUT = 0x4005 }
264 enum : uint { DMLERR_INVALIDPARAMETER = 0x4006 }
265 enum : uint { DMLERR_LOW_MEMORY = 0x4007 }
266 enum : uint { DMLERR_MEMORY_ERROR = 0x4008 }
267 enum : uint { DMLERR_NOTPROCESSED = 0x4009 }
268 enum : uint { DMLERR_NO_CONV_ESTABLISHED = 0x400a }
269 enum : uint { DMLERR_POKEACKTIMEOUT = 0x400b }
270 enum : uint { DMLERR_POSTMSG_FAILED = 0x400c }
271 enum : uint { DMLERR_REENTRANCY = 0x400d }
272 enum : uint { DMLERR_SERVER_DIED = 0x400e }
273 enum : uint { DMLERR_SYS_ERROR = 0x400f }
274 enum : uint { DMLERR_UNADVACKTIMEOUT = 0x4010 }
275 enum : uint { DMLERR_UNFOUND_QUEUE_ID = 0x4011 }
276
277 enum : uint { DMLERR_LAST = 0x4011 }
278
279 extern(Windows) export HSZ DdeCreateStringHandleA( DWORD idInst, LPCSTR psz, int iCodePage);
280 extern(Windows) export HSZ DdeCreateStringHandleW( DWORD idInst, LPCWSTR psz, int iCodePage);
281 // #ifdef UNICODE
282 alias DdeCreateStringHandleW DdeCreateStringHandle;
283 // #else
284 // #...
285 // #endif // !UNICODE
286 extern(Windows) export DWORD DdeQueryStringA( DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, int iCodePage);
287 extern(Windows) export DWORD DdeQueryStringW( DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, int iCodePage);
288 // #ifdef UNICODE
289 alias DdeQueryStringW DdeQueryString;
290 // #else
291 // #...
292 // #endif // !UNICODE
293 extern(Windows) export BOOL DdeFreeStringHandle( DWORD idInst, HSZ hsz);
294 extern(Windows) export BOOL DdeKeepStringHandle( DWORD idInst, HSZ hsz);
295 extern(Windows) export int DdeCmpStringHandles( HSZ hsz1, HSZ hsz2);
296
297 // #ifndef NODDEMLSPY
298
299 struct tagDDEML_MSG_HOOK_DATA {
300 UINT_PTR uiLo;
301 UINT_PTR uiHi;
302 DWORD cbData;
303 DWORD Data[8];
304 }
305 alias tagDDEML_MSG_HOOK_DATA DDEML_MSG_HOOK_DATA;
306 alias tagDDEML_MSG_HOOK_DATA* PDDEML_MSG_HOOK_DATA;
307
308 struct tagMONMSGSTRUCT {
309 UINT cb;
310 HWND hwndTo;
311 DWORD dwTime;
312 HANDLE hTask;
313 UINT wMsg;
314 WPARAM wParam;
315 LPARAM lParam;
316 DDEML_MSG_HOOK_DATA dmhd;
317 }
318 alias tagMONMSGSTRUCT MONMSGSTRUCT;
319 alias tagMONMSGSTRUCT* PMONMSGSTRUCT;
320
321 struct tagMONCBSTRUCT {
322 UINT cb;
323 DWORD dwTime;
324 HANDLE hTask;
325 DWORD dwRet;
326 UINT wType;
327 UINT wFmt;
328 HCONV hConv;
329 HSZ hsz1;
330 HSZ hsz2;
331 HDDEDATA hData;
332 ULONG_PTR dwData1;
333 ULONG_PTR dwData2;
334 CONVCONTEXT cc;
335 DWORD cbData;
336 DWORD Data[8];
337 }
338 alias tagMONCBSTRUCT MONCBSTRUCT;
339 alias tagMONCBSTRUCT* PMONCBSTRUCT;
340
341 struct tagMONHSZSTRUCTA {
342 UINT cb;
343 BOOL fsAction;
344 DWORD dwTime;
345 HSZ hsz;
346 HANDLE hTask;
347 CHAR str[1];
348 }
349 alias tagMONHSZSTRUCTA MONHSZSTRUCTA;
350 alias tagMONHSZSTRUCTA* PMONHSZSTRUCTA;
351
352 struct tagMONHSZSTRUCTW {
353 UINT cb;
354 BOOL fsAction;
355 DWORD dwTime;
356 HSZ hsz;
357 HANDLE hTask;
358 WCHAR str[1];
359 }
360 alias tagMONHSZSTRUCTW MONHSZSTRUCTW;
361 alias tagMONHSZSTRUCTW* PMONHSZSTRUCTW;
362
363 // #ifdef UNICODE
364 alias MONHSZSTRUCTW MONHSZSTRUCT;
365 alias PMONHSZSTRUCTW PMONHSZSTRUCT;
366 // #else
367 // ...
368 // #endif // UNICODE
369
370 enum : uint { MH_CREATE = 1 }
371 enum : uint { MH_KEEP = 2 }
372 enum : uint { MH_DELETE = 3 }
373 enum : uint { MH_CLEANUP = 4 }
374
375 struct tagMONERRSTRUCT {
376 UINT cb;
377 UINT wLastError;
378 DWORD dwTime;
379 HANDLE hTask;
380 }
381 alias tagMONERRSTRUCT MONERRSTRUCT;
382 alias tagMONERRSTRUCT* PMONERRSTRUCT;
383
384 struct tagMONLINKSTRUCT {
385 UINT cb;
386 DWORD dwTime;
387 HANDLE hTask;
388 BOOL fEstablished;
389 BOOL fNoData;
390 HSZ hszSvc;
391 HSZ hszTopic;
392 HSZ hszItem;
393 UINT wFmt;
394 BOOL fServer;
395 HCONV hConvServer;
396 HCONV hConvClient;
397 }
398 alias tagMONLINKSTRUCT MONLINKSTRUCT;
399 alias tagMONLINKSTRUCT* PMONLINKSTRUCT;
400
401 struct tagMONCONVSTRUCT {
402 UINT cb;
403 BOOL fConnect;
404 DWORD dwTime;
405 HANDLE hTask;
406 HSZ hszSvc;
407 HSZ hszTopic;
408 HCONV hConvClient;
409 HCONV hConvServer;
410 }
411 alias tagMONCONVSTRUCT MONCONVSTRUCT;
412 alias tagMONCONVSTRUCT* PMONCONVSTRUCT;
413
414 enum : uint { MAX_MONITORS = 4 }
415 enum : uint { APPCLASS_MONITOR = 0x00000001 }
416 const uint XTYP_MONITOR = 0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK;
417
418 enum : uint { MF_HSZ_INFO = 0x01000000 }
419 enum : uint { MF_SENDMSGS = 0x02000000 }
420 enum : uint { MF_POSTMSGS = 0x04000000 }
421 enum : uint { MF_CALLBACKS = 0x08000000 }
422 enum : uint { MF_ERRORS = 0x10000000 }
423 enum : uint { MF_LINKS = 0x20000000 }
424 enum : uint { MF_CONV = 0x40000000 }
425
426 enum : uint { MF_MASK = 0xFF000000 }
427 // #endif /* NODDEMLSPY */
428
429 // #ifdef __cplusplus
430 // }
431 // #endif /* __cplusplus */
432
433 // #endif /* _INC_DDEMLH */
434