Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

333 lines
12 KiB

  1. /*
  2. * DDESPY.H
  3. *
  4. * Header file for DDESPY Symbols
  5. */
  6. #define DDEMLDB
  7. #include <ddeml.h>
  8. #include "dialog.h"
  9. #define MH_INTCREATE 5
  10. #define MH_INTKEEP 6
  11. #define MH_INTDELETE 7
  12. #define IDI_DDESPY 100
  13. #define IDD_MSGFILTERS 300
  14. #define IDRB_WM_DDE_INITIATE 305
  15. #define IDRB_WM_DDE_TERMINATE 306
  16. #define IDRB_WM_DDE_ADVISE 307
  17. #define IDRB_WM_DDE_UNADVISE 308
  18. #define IDRB_WM_DDE_ACK 309
  19. #define IDRB_WM_DDE_DATA 310
  20. #define IDRB_WM_DDE_REQUEST 311
  21. #define IDRB_WM_DDE_POKE 312
  22. #define IDRB_WM_DDE_EXECUTE 313
  23. #define IDRB_XTYP_ERROR 314
  24. #define IDRB_XTYP_ADVDATA 315
  25. #define IDRB_XTYP_ADVREQ 316
  26. #define IDRB_XTYP_ADVSTART 317
  27. #define IDRB_XTYP_ADVSTOP 318
  28. #define IDRB_XTYP_EXECUTE 319
  29. #define IDRB_XTYP_CONNECT 320
  30. #define IDRB_XTYP_CONNECT_CONFIRM 321
  31. #define IDRB_XACT_COMPLETE 322
  32. #define IDRB_XTYP_POKE 323
  33. #define IDRB_XTYP_REGISTER 324
  34. #define IDRB_XTYP_REQUEST 325
  35. #define IDRB_XTYP_DISCONNECT 326
  36. #define IDRB_XTYP_UNREGISTER 327
  37. #define IDRB_XTYP_WILDCONNECT 328
  38. #define IDRB_TERSE 329
  39. #define IDR_ACCEL 30
  40. #define IDR_MENU 31
  41. #define IDD_VALUEENTRY 50
  42. #define IDD_ABOUTBOX 51
  43. #define IDD_OPEN 52
  44. #define IDM_OUTPUT_FIRST 100
  45. #define IDM_OUTPUT_FILE 100
  46. #define IDM_OUTPUT_DEBUG 101
  47. #define IDM_OUTPUT_SCREEN 102
  48. #define IDM_CLEARSCREEN 103
  49. #define IDM_MARK 104
  50. #define IDM_FILTER_FIRST 200
  51. #define IDM_FILTER_HSZINFO 200
  52. #define IDM_FILTER_INIT_TERM 201
  53. #define IDM_FILTER_DDEMSGS 202
  54. #define IDM_FILTER_CALLBACKS 203
  55. #define IDM_FILTER_ERRORS 204
  56. #define IDM_FILTER_DIALOG 205
  57. #define IDM_TRACK_FIRST 301
  58. #define IDM_TRACK_HSZS 301
  59. #define IDM_TRACK_CONVS 302
  60. #define IDM_TRACK_LINKS 303
  61. #define IDM_TRACK_SVRS 304
  62. #define IDM_TRACK_LAST 304
  63. #define IDM_ABOUT 401
  64. #define IDM_TEST 402
  65. #define IDM_MSGF_0 500
  66. #define IDM_MSGF_1 501
  67. #define IDM_MSGF_2 502
  68. #define IDM_MSGF_3 503
  69. #define IDM_MSGF_4 504
  70. #define IDM_MSGF_5 505
  71. #define IDM_MSGF_6 506
  72. #define IDM_MSGF_7 507
  73. #define IDM_MSGF_8 508
  74. #define IDM_CBF_0 600
  75. #define IDM_CBF_1 601
  76. #define IDM_CBF_2 602
  77. #define IDM_CBF_3 603
  78. #define IDM_CBF_4 604
  79. #define IDM_CBF_5 605
  80. #define IDM_CBF_6 606
  81. #define IDM_CBF_7 607
  82. #define IDM_CBF_8 608
  83. #define IDM_CBF_9 609
  84. #define IDM_CBF_10 610
  85. #define IDM_CBF_11 611
  86. #define IDM_CBF_12 612
  87. #define IDM_CBF_13 613
  88. #define IDM_CBF_14 614
  89. #define IDS_TITLE 0
  90. #define IDS_DEFAULT_OUTPUT_FNAME 1
  91. #define IDS_INIFNAME 2
  92. #define IDS_CLASS 3
  93. #define IDS_HUH 4
  94. #define IDS_ZERO 5
  95. #define IDS_CRLF 6
  96. #define IDS_TRACKTITLE_1 7
  97. #define IDS_TRACKTITLE_2 8
  98. #define IDS_TRACKTITLE_3 9
  99. #define IDS_TRACKTITLE_4 10
  100. #define IDS_TRACKHEADING_1 11
  101. #define IDS_TRACKHEADING_2 12
  102. #define IDS_TRACKHEADING_3 13
  103. #define IDS_TRACKHEADING_4 14
  104. #define IDS_QCLOSEFILE_TEXT 15
  105. #define IDS_QCLOSEFILE_CAPTION 16
  106. #define IDS_ACTION_CLEANEDUP 17
  107. #define IDS_ACTION_DESTROYED 18
  108. #define IDS_ACTION_INCREMENTED 19
  109. #define IDS_ACTION_CREATED 20
  110. #define IDS_SENT 21
  111. #define IDS_POSTED 22
  112. #define IDS_INPUT_DATA 23
  113. #define IDS_TABDDD 24
  114. #define IDS_OUTPUT_DATA 25
  115. #define IDS_WARM 26
  116. #define IDS_HOT 27
  117. #define IDS_UNKNOWN_CALLBACK 28
  118. #define IDS_APPIS 29
  119. #define IDS_TOPICIS 30
  120. #define IDS_ITEMIS 31
  121. #define IDS_OR 32
  122. #define IDS_FACKREQ 33
  123. #define IDS_DEFERUPD 34
  124. #define IDS_FACK 35
  125. #define IDS_FBUSY 36
  126. #define IDS_FRELEASE 37
  127. #define IDS_FREQUESTED 38
  128. #define IDS_ERRST0 39
  129. #define IDS_ERRST1 40
  130. #define IDS_ERRST2 41
  131. #define IDS_ERRST3 42
  132. #define IDS_ERRST4 43
  133. #define IDS_ERRST5 44
  134. #define IDS_ERRST6 45
  135. #define IDS_ERRST7 46
  136. #define IDS_ERRST8 47
  137. #define IDS_ERRST9 48
  138. #define IDS_ERRST10 49
  139. #define IDS_ERRST11 50
  140. #define IDS_ERRST12 51
  141. #define IDS_ERRST13 52
  142. #define IDS_ERRST14 53
  143. #define IDS_ERRST15 54
  144. #define IDS_ERRST16 55
  145. #define IDS_ERRST17 56
  146. #define IDS_MSG0 57
  147. #define IDS_MSG1 58
  148. #define IDS_MSG2 59
  149. #define IDS_MSG3 60
  150. #define IDS_MSG4 61
  151. #define IDS_MSG5 62
  152. #define IDS_MSG6 63
  153. #define IDS_MSG7 64
  154. #define IDS_MSG8 65
  155. #define IDS_TYPE0 66
  156. #define IDS_TYPE1 67
  157. #define IDS_TYPE2 68
  158. #define IDS_TYPE3 69
  159. #define IDS_TYPE4 70
  160. #define IDS_TYPE5 71
  161. #define IDS_TYPE6 72
  162. #define IDS_TYPE7 73
  163. #define IDS_TYPE8 74
  164. #define IDS_TYPE9 75
  165. #define IDS_TYPE10 76
  166. #define IDS_TYPE11 77
  167. #define IDS_TYPE12 78
  168. #define IDS_TYPE13 79
  169. #define IDS_TYPE14 80
  170. #define IDS_TYPE15 81
  171. #define IDS_INVALID_FNAME 82
  172. #define IDS_PROF_OUT_FILE 83
  173. #define IDS_PROF_OUT_DEBUG 84
  174. #define IDS_PROF_OUT_SCREEN 85
  175. #define IDS_PROF_MONITOR_STRINGHANDLES 86
  176. #define IDS_PROF_MONITOR_INITIATES 87
  177. #define IDS_PROF_MONITOR_DDE_MESSAGES 88
  178. #define IDS_PROF_MONITOR_CALLBACKS 89
  179. #define IDS_PROF_MONITOR_ERRORS 90
  180. #define IDS_PROF_TRACK_STRINGHANDLES 91
  181. #define IDS_PROF_TRACK_LINKS 92
  182. #define IDS_PROF_TRACK_CONVERSATIONS 93
  183. #define IDS_PROF_TRACK_SERVICES 94
  184. #define IDS_PROF_TERSE 95
  185. #define IDS_YES 96
  186. #define IDS_NO 97
  187. #define IDS_MARKDLGTITLE 98
  188. #define IDS_SEPERATOR 99
  189. #define IDS_MARKTEXT 100
  190. #define IDS_LISTCLASS 101
  191. #define IDS_LBOX 102
  192. #define IDS_WILD 103
  193. #define IDS_STRINGCLASS 104
  194. #define IDS_FMT_CB1 105
  195. #define IDS_FMT_CB2 106
  196. #define IDS_FMT_CTXT1 107
  197. #define IDS_FMT_DATAIS1 108
  198. #define IDS_FMT_ER1 109
  199. #define IDS_FMT_EXEC1 110
  200. #define IDS_FMT_MSG1 111
  201. #define IDS_FMT_MSG2 112
  202. #define IDS_FMT_STATUSIS 113
  203. #define IDS_FMT_TRS_CB1 114
  204. #define IDS_FMT_TRS_CB2 115
  205. #define IDS_FMT_TRS_CTXT1 116
  206. #define IDS_FMT_TRS_DATAIS1 117
  207. #define IDS_FMT_TRS_ER1 118
  208. #define IDS_FMT_TRS_EXEC1 119
  209. #define IDS_FMT_TRS_MSG1 120
  210. #define IDS_FMT_TRS_MSG2 121
  211. #define IDS_FMT_TRS_STATUSIS 122
  212. #define IDS_FMT_SH_MSG1 123
  213. #define IDS_BADATOM 124
  214. #define IDS_LAST 124
  215. #define T_ATOM 0x0001
  216. #define T_OPTIONHANDLE 0x0002
  217. #define T_FORMAT 0x0004
  218. #define T_STATUS 0x0008
  219. #define T_DATAHANDLE 0x0010
  220. #define T_STRINGHANDLE 0x0020
  221. #define T_VALUE 0x0040
  222. #define T_APP 0x0080
  223. #define T_TOPIC 0x0100
  224. #define T_ITEM 0x0200
  225. #define T_OR 0x0400
  226. #define IO_FILE 0
  227. #define IO_DEBUG 1
  228. #define IO_SCREEN 2
  229. #define IO_COUNT 3
  230. #define IF_HSZ 0
  231. #define IF_SEND 1
  232. #define IF_POST 2
  233. #define IF_CB 3
  234. #define IF_ERR 4
  235. #define IF_COUNT 5
  236. #define IT_HSZS 0
  237. #define IT_CONVS 1
  238. #define IT_LINKS 2
  239. #define IT_SVRS 3
  240. #define IT_COUNT 4
  241. #define MAX_FNAME MAX_PATH
  242. #define BUFFER_SIZE 400
  243. #define MAX_MARK 32
  244. #define MAX_DISPDATA 48 // max bytes of non-text data to dump
  245. #define CLINES 1000
  246. #define CCHARS 200
  247. extern HINSTANCE hInst;
  248. /* macro definitions */
  249. #define MyAlloc(cb) (LPTSTR)LocalAlloc(LPTR, (cb))
  250. #define MyFree(p) (LocalUnlock((HANDLE)(p)), LocalFree((HANDLE)(p)))
  251. #define RefString(id) (LPTSTR)apszResources[id]
  252. #define Type2String(type) apszResources[IDS_TYPE0 + ((type & XTYP_MASK) >> XTYP_SHIFT)]
  253. #define MPRT(b) (isprint(b) ? (b) : '.')
  254. /* prototype definitions */
  255. BOOL InitApplication(HANDLE);
  256. BOOL InitInstance(HANDLE, INT);
  257. VOID CloseApp(VOID);
  258. LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
  259. BOOL CALLBACK About(HWND, UINT, WPARAM, LPARAM);
  260. BOOL SetFilters(VOID);
  261. BOOL CALLBACK OpenDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  262. BOOL CALLBACK FilterDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  263. LPTSTR DisectMsgLP(UINT msg, MONMSGSTRUCT *pmms, LPTSTR pszBuf);
  264. LPTSTR DisectWord(UINT type, UINT data, DDEML_MSG_HOOK_DATA *pdmhd, LPTSTR pstr);
  265. LPTSTR pdf(UINT fmt);
  266. LPTSTR DumpFormat(UINT fmt, LPTSTR pstr);
  267. LPTSTR DdeMsg2String(UINT msg);
  268. LPTSTR Error2String(UINT error);
  269. LPTSTR DumpData(LPBYTE pData, UINT cb, TCHAR *szBuf, UINT fmt);
  270. LPTSTR GetHszName(HSZ hsz);
  271. VOID OutputString(LPTSTR pstr);
  272. VOID GetProfile(VOID);
  273. VOID SaveProfile(VOID);
  274. BOOL GetProfileBoolean(LPTSTR pszKey, BOOL fDefault);
  275. VOID SetProfileBoolean(LPTSTR pszKey, BOOL fSet);
  276. HDDEDATA CALLBACK DdeCallback(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1,
  277. HSZ hsz2, HDDEDATA hData, UINT lData1, UINT lData2);
  278. INT_PTR FAR DoDialog(LPTSTR lpTemplateName, DLGPROC lpDlgProc, UINT param,
  279. BOOL fRememberFocus, HWND hwndParent, HANDLE hInst);
  280. BOOL CALLBACK MarkDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  281. /* testsubs.c prototypes */
  282. /* StringWindow structure */
  283. typedef struct {
  284. INT cchLine;
  285. INT cLine;
  286. INT offBuffer;
  287. INT offBufferMax;
  288. INT offBottomLine;
  289. INT offOutput;
  290. INT cBottomLine;
  291. INT cLeftChar;
  292. } STRWND;
  293. BOOL InitTestSubs(VOID);
  294. VOID CloseTestSubs(HANDLE hInst);
  295. VOID NextLine(STRWND *psw);
  296. VOID DrawString(HWND hwnd, TCHAR *sz);
  297. VOID ClearScreen(STRWND *psw);
  298. LRESULT CALLBACK StrWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  299. VOID scroll(HWND hwnd, UINT msg, UINT sliderpos, UINT style);
  300. BOOL StrWndCreate(HWND hwnd, INT cchLine, INT cLine);
  301. VOID PaintStrWnd(HWND hwnd, LPPAINTSTRUCT pps);
  302. #ifdef DBCS
  303. #define strchr My_mbschr
  304. #ifdef stricmp
  305. #undef stricmp
  306. #endif
  307. #define stricmp lstrcmpi
  308. LPTSTR __cdecl My_mbschr(LPTSTR, TCHAR);
  309. #endif // DBCS