home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / SAMPLES / DDEML / CLIENT / DDEMLCL.H_ / DDEMLCL.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  6.6 KB  |  197 lines

  1. #include <windows.h>
  2. #include <ddeml.h>
  3. #include "resource.h"
  4.  
  5. #define WINDOWMENU  3    /* position of window menu         */
  6.  
  7. // predefined format list item
  8.  
  9. typedef struct {
  10.     ATOM atom;
  11.     PSTR sz;
  12. } FORMATINFO;
  13. #define CFORMATS 3
  14.  
  15. // conversation (MDI child) window information
  16. typedef struct {
  17.     HWND hwndXaction;       // last xaction window with focus, 0 if none.
  18.     BOOL fList;
  19.     HCONV hConv;
  20.     HSZ hszTopic;
  21.     HSZ hszApp;
  22.     int x;          // next child coord.
  23.     int y;
  24.     CONVINFO ci; // most recent status info.
  25. } MYCONVINFO;       // parameters to AddConv() in reverse order.
  26. #define CHILDCBWNDEXTRA        2
  27. #define UM_GETNEXTCHILDX    (WM_USER + 200)
  28. #define UM_GETNEXTCHILDY    (WM_USER + 201)
  29. #define UM_DISCONNECTED     (WM_USER + 202)
  30.  
  31. // transaction processing structure - this structure is associated with
  32. // infoctrl control windows.  A handle to this structure is placed into
  33. // the first window word of the control.
  34. typedef struct {    // used to passinfo to/from TransactionDlgProc and
  35.     DWORD ret;      // TextEntryDlgProc.
  36.     DWORD Result;
  37.     DWORD ulTimeout;
  38.     WORD wType;
  39.     HCONV hConv;
  40.     HDDEDATA hDdeData;
  41.     WORD wFmt;
  42.     HSZ hszItem;
  43.     WORD fsOptions;
  44. } XACT;
  45.  
  46. typedef struct {
  47.     HDDEDATA hData;
  48.     HSZ hszItem;
  49.     WORD wFmt;
  50. } OWNED;
  51.  
  52. // transaction option flags - for fsOptions field and DefOptions global.
  53.  
  54. #define XOPT_NODATA             0x0001
  55. #define XOPT_ACKREQ             0x0002
  56. #define XOPT_DISABLEFIRST       0x0004
  57. #define XOPT_ABANDONAFTERSTART  0x0008
  58. #define XOPT_BLOCKRESULT        0x0010
  59. #define XOPT_ASYNC              0x0020
  60. #define XOPT_COMPLETED          0x8000      // used internally only.
  61.  
  62. /* attribute flags for DlgDirList */
  63. #define ATTR_DIRS    0xC010        /* find drives and directories */
  64. #define ATTR_FILES    0x0000        /* find ordinary files           */
  65. #define PROP_FILENAME    szPropertyName    /* name of property for dialog */
  66. #define MAX_OWNED   20
  67.  
  68. /*
  69.  *  GLOBALS
  70.  */
  71. extern CONVCONTEXT CCFilter;
  72. extern DWORD idInst;
  73. extern HANDLE hInst;        /* application instance handle          */
  74. extern HANDLE hAccel;        /* resource handle of accelerators      */
  75. extern HWND hwndFrame;        /* main window handle              */
  76. extern HWND hwndMDIClient;    /* handle of MDI Client window          */
  77. extern HWND hwndActive;     /* handle of current active MDI child      */
  78. extern HWND hwndActiveEdit;    /* handle of edit control in active child */
  79. extern LONG styleDefault;    /* default child creation state       */
  80. extern WORD SyncTimeout;
  81. extern LONG DefTimeout;
  82. extern WORD wDelay;
  83. extern BOOL fEnableCBs;
  84. extern BOOL fEnableOneCB;
  85. extern BOOL fBlockNextCB;
  86. extern BOOL fTermNextCB;
  87. extern BOOL fAutoReconnect;
  88. extern HDDEDATA hDataOwned;
  89. extern WORD fmtLink;        // registered LINK clipboard fmt
  90. extern WORD DefOptions;
  91. extern char szChild[];        /* class of child              */
  92. extern char szList[];        /* class of child              */
  93. extern char szSearch[];     /* search string              */
  94. extern char *szDriver;        /* name of printer driver          */
  95. extern char szPropertyName[];    /* filename property for dialog box      */
  96. extern int iPrinter;        /* level of printing capability       */
  97. extern BOOL fCase;        /* searches case sensitive          */
  98. extern WORD cFonts;        /* number of fonts enumerated          */
  99. extern FORMATINFO aFormats[];
  100. extern OWNED aOwned[MAX_OWNED];
  101. extern WORD cOwned;
  102.  
  103.  
  104. // MACROS
  105.  
  106. #ifdef NODEBUG
  107. #define MyAlloc(cb)     (PSTR)LocalAlloc(LPTR, (cb))
  108. #define MyFree(p)       (LocalUnlock((HANDLE)(p)), LocalFree((HANDLE)(p)))
  109. #else   // DEBUG
  110.  
  111. #define MyAlloc(cb)     DbgAlloc((WORD)cb)
  112. #define MyFree(p)       DbgFree((PSTR)p)
  113. #endif //NODEBUG
  114.  
  115.  
  116. /*  externally declared functions
  117.  */
  118.  
  119. // ddemlcl.c
  120.  
  121. BOOL FAR PASCAL InitializeApplication(VOID);
  122. BOOL FAR PASCAL InitializeInstance(WORD);
  123. HWND FAR PASCAL AddFile(char *);
  124. VOID FAR PASCAL ReadFile(HWND);
  125. VOID FAR PASCAL SaveFile(HWND);
  126. BOOL FAR PASCAL ChangeFile(HWND);
  127. int FAR PASCAL LoadFile(HWND, char *);
  128. VOID FAR PASCAL PrintFile(HWND);
  129. BOOL FAR PASCAL GetInitializationData(HWND);
  130. short FAR CDECL MPError(HWND,WORD,WORD,...);
  131. VOID FAR PASCAL Find(void);
  132. VOID FAR PASCAL FindNext(void);
  133. VOID FAR PASCAL FindPrev(void);
  134. VOID FAR PASCAL MPSpotHelp(HWND,POINT);
  135. LONG FAR PASCAL __export FrameWndProc(HWND,UINT,WPARAM,LPARAM);
  136. LONG FAR PASCAL __export MDIChildWndProc(HWND,UINT,WPARAM,LPARAM);
  137. HDC FAR PASCAL GetPrinterDC(void);
  138. VOID NEAR PASCAL SetSaveFrom (HWND, PSTR);
  139. BOOL NEAR PASCAL RealSlowCompare (PSTR, PSTR);
  140. VOID FAR PASCAL FindPrev (void);
  141. VOID FAR PASCAL FindNext (void);
  142. BOOL NEAR PASCAL IsWild (PSTR);
  143. VOID NEAR PASCAL SelectFile (HWND);
  144. VOID NEAR PASCAL FindText ( int );
  145. HCONV CreateConv(HSZ hszApp, HSZ hszTopic, BOOL fList, WORD *pError);
  146. HWND FAR PASCAL AddConv(HSZ hszApp, HSZ hszTopic, HCONV hConv, BOOL fList);
  147. PSTR GetConvListText(HCONVLIST hConvList);
  148. PSTR GetConvInfoText(HCONV hConv, CONVINFO *pci);
  149. PSTR GetConvTitleText(HCONV hConv, HSZ hszApp, HSZ hszTopic, BOOL fList);
  150. PSTR Status2String(WORD status);
  151. PSTR State2String(WORD state);
  152. PSTR Error2String(WORD error);
  153. PSTR Type2String(WORD wType, WORD fsOptions);
  154. PSTR GetHSZName(HSZ hsz);
  155. DWORD FAR PASCAL __export MyMsgFilterProc(int nCode, WORD wParam, DWORD lParam);
  156. typedef DWORD FAR PASCAL FILTERPROC(int nCode, WORD wParam, DWORD lParam);
  157. extern FILTERPROC  *lpMsgFilterProc;
  158.  
  159. // dialog.c
  160.  
  161.  
  162. int FAR DoDialog(LPCSTR lpTemplateName, FARPROC lpDlgProc, DWORD param,
  163.         BOOL fRememberFocus);
  164. BOOL FAR PASCAL __export AboutDlgProc(HWND,WORD,WORD,LONG);
  165. BOOL FAR PASCAL __export ConnectDlgProc(HWND,WORD,WORD,LONG);
  166. BOOL FAR PASCAL __export TransactDlgProc(HWND,WORD,WORD,LONG);
  167. BOOL FAR PASCAL __export AdvOptsDlgProc(HWND, WORD, WORD, LONG);
  168. BOOL FAR PASCAL __export TextEntryDlgProc(HWND, WORD, WORD, LONG);
  169. BOOL FAR PASCAL __export ViewHandleDlgProc(HWND, WORD, WORD, LONG);
  170. BOOL FAR PASCAL __export TimeoutDlgProc(HWND,WORD,WORD,LONG);
  171. BOOL FAR PASCAL __export DelayDlgProc(HWND,WORD,WORD,LONG);
  172. BOOL FAR PASCAL __export ContextDlgProc(HWND,WORD,WORD,LONG);
  173. VOID Delay(DWORD delay);
  174.  
  175. // dde.c
  176.  
  177.  
  178. BOOL ProcessTransaction(XACT *pxact);
  179. VOID CompleteTransaction(HWND hwndInfoCtr, XACT *pxact);
  180. HDDEDATA EXPENTRY __export DdeCallback(WORD wType, WORD wFmt, HCONV hConv, HSZ hsz1,
  181.         HSZ hsz2, HDDEDATA hData, DWORD lData1, DWORD lData2);
  182. HWND MDIChildFromhConv(HCONV hConv);
  183. HWND FindAdviseChild(HWND hwndMDI, HSZ hszItem, WORD wFmt);
  184. HWND FindListWindow(HCONVLIST hConvList);
  185. PSTR GetTextData(HDDEDATA hData);
  186. PSTR GetFormatData(HDDEDATA hData);
  187. int MyGetClipboardFormatName(WORD fmt, LPSTR lpstr, int cbMax);
  188. PSTR GetFormatName(WORD wFmt);
  189. BOOL MyDisconnect(HCONV hConv);
  190.  
  191. // mem.c
  192.  
  193.  
  194. PSTR DbgAlloc(WORD cb);
  195. PSTR DbgFree(PSTR p);
  196.  
  197.