home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winbase / ipc / ddeml / server / server.h < prev    next >
C/C++ Source or Header  |  1997-10-05  |  5KB  |  169 lines

  1.  
  2. /******************************************************************************\
  3. *       This is a part of the Microsoft Source Code Samples.
  4. *       Copyright (C) 1993-1997 Microsoft Corporation.
  5. *       All rights reserved.
  6. *       This source code is only intended as a supplement to
  7. *       Microsoft Development Tools and/or WinHelp documentation.
  8. *       See these sources for detailed information regarding the
  9. *       Microsoft samples programs.
  10. \******************************************************************************/
  11.  
  12. #include <windows.h>
  13. #include <ddeml.h>
  14. #include <tchar.h>
  15.  
  16. #define IDM_ABOUT 100
  17. #define IDM_BLOCKALLCBS 200
  18. #define IDM_ENABLEONECB 201
  19. #define IDM_BLOCKNEXTCB 202
  20. #define IDM_TERMNEXTCB  203
  21. #define IDM_RUNAWAY     204
  22. #define IDM_CHANGEDATA  205
  23. #define IDM_RENDERDELAY 206
  24. #define IDM_SETTOPIC    207
  25. #define IDM_SETSERVER   208
  26. #define IDM_UNBLOCKALLCBS 209
  27. #define IDM_HELP        210
  28. #define IDM_CONTEXT     211
  29. #define IDM_APPOWNED    212
  30.  
  31. #define IDS_BADLENGTH   1
  32.  
  33. #define MAX_TOPIC       20
  34. #define MAX_COMMENT     40
  35. #define MAX_EXEC        40
  36. #define CCHARS          80
  37. #define CLINES          40
  38.  
  39. #define UM_CHGDATA      (WM_USER + 435)
  40.  
  41. #define CSYSTEMITEMS 4
  42. #define CTESTITEMS  4
  43. #define CTOPICS     2
  44.  
  45. #include "dialog.h"
  46.  
  47. /****** Structrues ******/
  48.  
  49. // predefined format list item
  50.  
  51. typedef struct {
  52.     ATOM atom;
  53.     PTSTR sz;
  54. } FORMATINFO;
  55. #define CFORMATS 3
  56.  
  57. extern FORMATINFO aFormats[];
  58.  
  59. typedef struct _XFERINFO {
  60.     UINT wType;
  61.     UINT wFmt;
  62.     HCONV hConv;
  63.     HSZ hszTopic;
  64.     HSZ hszItem;
  65.     HDDEDATA hData;
  66.     DWORD lData1;
  67.     DWORD lData2;
  68. } XFERINFO;
  69. typedef XFERINFO *PXFERINFO;
  70.  
  71. typedef struct _ITEMLIST {
  72.     HSZ hszItem;
  73.     HDDEDATA (*npfnCallback)(PXFERINFO, WORD);
  74.     PTSTR pszItem;
  75. } ITEMLIST;
  76.  
  77. typedef struct _TOPICLIST {
  78.     HSZ hszTopic;
  79.     ITEMLIST *pItemList;
  80.     UINT cItems;
  81.     PTSTR pszTopic;
  82. } TOPICLIST;
  83.  
  84. typedef struct {    // used to passinfo to/from TextDataEntryDlgProc and
  85.     HDDEDATA hDdeData;
  86.     UINT wFmt;
  87.     HSZ hszItem;
  88. } XACT;
  89.  
  90.  
  91.  
  92. // GLOBALS
  93.  
  94. extern DWORD idInst;
  95. extern CONVCONTEXT CCFilter;
  96. extern HANDLE hInst;
  97. extern HWND hwndServer;
  98. extern RECT rcRand;
  99. extern RECT rcCount;
  100. extern RECT rcComment;
  101. extern RECT rcExec;
  102. extern RECT rcConnCount;
  103. extern RECT rcRndrDelay;
  104. extern RECT rcRunaway;
  105. extern RECT rcAllBlock;
  106. extern RECT rcNextAction;
  107. extern RECT rcHugeSize;
  108. extern RECT rcAppowned;
  109. extern BOOL fAllBlocked;
  110. extern BOOL fAllEnabled;
  111. extern BOOL fEnableOneCB;
  112. extern BOOL fBlockNextCB;
  113. extern BOOL fTermNextCB;
  114. extern BOOL fAppowned;
  115. extern WORD cRunaway;
  116. extern WORD RenderDelay;
  117. extern DWORD count;
  118. extern HSZ hszAppName;
  119. extern TCHAR szClass[];
  120. extern TCHAR szTopic[MAX_TOPIC];
  121. extern TCHAR szServer[MAX_TOPIC];
  122. extern TCHAR szComment[MAX_COMMENT];
  123. extern TCHAR szExec[MAX_EXEC];
  124. extern TCHAR *pszComment;
  125. extern WORD seed;
  126. extern WORD cyText;
  127. extern WORD cServers;
  128. extern HDDEDATA hDataHelp[CFORMATS];
  129. extern HDDEDATA hDataCount[CFORMATS];
  130. extern HDDEDATA hDataRand[CFORMATS];
  131. extern HDDEDATA hDataHuge[CFORMATS];
  132. extern DWORD cbHuge;
  133.  
  134. extern TCHAR szDdeHelp[];
  135. extern FORMATINFO aFormats[CFORMATS];
  136. extern ITEMLIST SystemTopicItemList[CSYSTEMITEMS];
  137. extern ITEMLIST TestTopicItemList[CTESTITEMS];
  138. extern TOPICLIST topicList[CTOPICS];
  139.  
  140.  
  141. // FUNCTIONS
  142.  
  143.  
  144. BOOL InitApplication(HANDLE);
  145. BOOL InitInstance(HANDLE, INT);
  146. INT FAR DoDialog(LPTSTR lpTemplateName, DLGPROC lpDlgProc, LPARAM param, BOOL fRememberFocus);
  147. LONG  APIENTRY MainWndProc(HWND, UINT, WPARAM, LONG);
  148. BOOL  APIENTRY About(HWND, UINT, WPARAM, LONG);
  149. BOOL  APIENTRY RenderDelayDlgProc(HWND, UINT, WPARAM, LONG);
  150. BOOL  APIENTRY SetTopicDlgProc(HWND, UINT, WPARAM, LONG);
  151. BOOL  APIENTRY SetServerDlgProc(HWND, UINT, WPARAM, LONG);
  152. BOOL  APIENTRY ContextDlgProc(HWND, UINT, WPARAM, LONG);
  153. VOID PaintServer(HWND hwnd);
  154. VOID DrawTextLine(HDC hdc, RECT *prcClip, RECT *prcText, PTSTR psz);
  155. HDDEDATA CALLBACK DdeCallback(UINT wType, UINT wFmt, HCONV hConv, HSZ hszTopic,
  156.         HSZ hszItem, HDDEDATA hData, DWORD lData1, DWORD lData2);
  157. HDDEDATA TopicListXfer(PXFERINFO pXferInfo, WORD iFmt);
  158. HDDEDATA ItemListXfer(PXFERINFO pXferInfo, WORD iFmt);
  159. HDDEDATA sysFormatsXfer(PXFERINFO pXferInfo, WORD iFmt);
  160. HDDEDATA TestRandomXfer(PXFERINFO pXferInfo, WORD iFmt);
  161. HDDEDATA TestCountXfer(PXFERINFO pXferInfo, WORD iFmt);
  162. HDDEDATA TestHugeXfer(PXFERINFO pXferInfo, WORD iFmt);
  163. HDDEDATA HelpXfer(PXFERINFO pXferInfo, WORD iFmt);
  164. VOID Hszize(VOID);
  165. VOID UnHszize(VOID);
  166. VOID Delay(DWORD delay, BOOL fModal);
  167.  
  168.  
  169.