home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / DDE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  9.8 KB  |  320 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * dde.h -       Dynamic Data Exchange structures and definitions              *
  4. *                                                                             *
  5. \*****************************************************************************/
  6.  
  7. /*
  8.  *      C/C++ Run Time Library - Version 6.0
  9.  *
  10.  *      Copyright (c) 1987, 1993 by Borland International
  11.  *      All Rights Reserved.
  12.  *
  13.  */
  14.  
  15. #ifndef __DDE_H         /* prevent multiple includes */
  16. #define __DDE_H
  17.  
  18. #ifndef RC_INVOKED
  19. #pragma option -a-      /* Assume byte packing throughout */
  20. #pragma warn -bbf       /* Turn off warning about bitfields */
  21. #endif  /* RC_INVOKED */
  22.  
  23. #if !defined(__FLAT__)
  24.  
  25. #ifndef __WINDOWS_H
  26. #include <windows.h>    /* <windows.h> must be included */
  27. #endif  /* __WINDOWS_H */
  28.  
  29. #ifndef RC_INVOKED
  30. #pragma option -a-      /* Assume byte packing throughout */
  31. #pragma warn -bbf       /* Turn off warning about bitfields */
  32. #endif  /* RC_INVOKED */
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {            /* Assume C declarations for C++ */
  36. #endif  /* __cplusplus */
  37.  
  38. /* DDE window messages */
  39.  
  40. #define WM_DDE_FIRST        0x03E0
  41. #define WM_DDE_INITIATE     (WM_DDE_FIRST)
  42. #define WM_DDE_TERMINATE    (WM_DDE_FIRST+1)
  43. #define WM_DDE_ADVISE       (WM_DDE_FIRST+2)
  44. #define WM_DDE_UNADVISE     (WM_DDE_FIRST+3)
  45. #define WM_DDE_ACK          (WM_DDE_FIRST+4)
  46. #define WM_DDE_DATA         (WM_DDE_FIRST+5)
  47. #define WM_DDE_REQUEST      (WM_DDE_FIRST+6)
  48. #define WM_DDE_POKE         (WM_DDE_FIRST+7)
  49. #define WM_DDE_EXECUTE      (WM_DDE_FIRST+8)
  50. #define WM_DDE_LAST         (WM_DDE_FIRST+8)
  51.  
  52. /****************************************************************************\
  53. *       DDEACK structure
  54. *
  55. *       Structure of wStatus (LOWORD(lParam)) in WM_DDE_ACK message
  56. *       sent in response to a WM_DDE_DATA, WM_DDE_REQUEST, WM_DDE_POKE,
  57. *       WM_DDE_ADVISE, or WM_DDE_UNADVISE message.
  58. *
  59. \****************************************************************************/
  60.  
  61. typedef struct tagDDEACK
  62. {
  63.     WORD    bAppReturnCode:8,
  64.             reserved:6,
  65.             fBusy:1,
  66.             fAck:1;
  67. } DDEACK;
  68.  
  69. /****************************************************************************\
  70. *       DDEADVISE structure
  71. *
  72. *       WM_DDE_ADVISE parameter structure for hOptions (LOWORD(lParam))
  73. *
  74. \****************************************************************************/
  75.  
  76. typedef struct tagDDEADVISE
  77. {
  78.     WORD    reserved:14,
  79.             fDeferUpd:1,
  80.             fAckReq:1;
  81.     short   cfFormat;
  82. } DDEADVISE;
  83.  
  84. /****************************************************************************\
  85. *       DDEDATA structure
  86. *
  87. *       WM_DDE_DATA parameter structure for hData (LOWORD(lParam)).
  88. *       The actual size of this structure depends on the size of
  89. *       the Value array.
  90. *
  91. \****************************************************************************/
  92.  
  93. typedef struct tagDDEDATA
  94. {
  95.     WORD    unused:12,
  96.             fResponse:1,
  97.             fRelease:1,
  98.             reserved:1,
  99.             fAckReq:1;
  100.     short   cfFormat;
  101.     BYTE     Value[1];
  102. } DDEDATA;
  103.  
  104.  
  105. /****************************************************************************\
  106. *       DDEPOKE structure
  107. *
  108. *       WM_DDE_POKE parameter structure for hData (LOWORD(lParam)).
  109. *       The actual size of this structure depends on the size of
  110. *       the Value array.
  111. *
  112. \****************************************************************************/
  113.  
  114. typedef struct tagDDEPOKE
  115. {
  116.     WORD    unused:13,  /* Earlier versions of DDE.H incorrectly */
  117.                         /* 12 unused bits.                       */
  118.             fRelease:1,
  119.             fReserved:2;
  120.     short   cfFormat;
  121.     BYTE    Value[1];   /* This member was named rgb[1] in previous */
  122.                         /* versions of DDE.H                        */
  123.  
  124. } DDEPOKE;
  125.  
  126. /****************************************************************************\
  127. * The following typedef's were used in previous versions of the Windows SDK.
  128. * They are still valid.  The above typedef's define exactly the same structures
  129. * as those below.  The above typedef names are recommended, however, as they
  130. * are more meaningful.
  131. *
  132. * Note that the DDEPOKE structure typedef'ed in earlier versions of DDE.H did
  133. * not correctly define the bit positions.
  134. \****************************************************************************/
  135.  
  136. typedef struct tagDDELN
  137. {
  138.     WORD    unused:13,
  139.             fRelease:1,
  140.             fDeferUpd:1,
  141.             fAckReq:1;
  142.     short   cfFormat;
  143. } DDELN;
  144.  
  145. typedef struct tagDDEUP
  146. {
  147.     WORD    unused:12,
  148.             fAck:1,
  149.             fRelease:1,
  150.             fReserved:1,
  151.             fAckReq:1;
  152.     short   cfFormat;
  153.     BYTE    rgb[1];
  154. } DDEUP;
  155.  
  156. #ifdef __cplusplus
  157. }                       /* End of extern "C" { */
  158. #endif  /* __cplusplus */
  159.  
  160. #else     /* defined __FLAT__ */
  161.  
  162. #ifndef _WINDEF_
  163. #include <windef.h>
  164. #endif
  165.  
  166. #ifndef RC_INVOKED
  167. #pragma option -a-      /* Assume byte packing throughout */
  168. #pragma warn -bbf       /* Turn off warning about bitfields */
  169. #endif  /* RC_INVOKED */
  170.  
  171. /* DDE window messages */
  172.  
  173. #define WM_DDE_FIRST        0x03E0
  174. #define WM_DDE_INITIATE     (WM_DDE_FIRST)
  175. #define WM_DDE_TERMINATE    (WM_DDE_FIRST+1)
  176. #define WM_DDE_ADVISE       (WM_DDE_FIRST+2)
  177. #define WM_DDE_UNADVISE     (WM_DDE_FIRST+3)
  178. #define WM_DDE_ACK              (WM_DDE_FIRST+4)
  179. #define WM_DDE_DATA             (WM_DDE_FIRST+5)
  180. #define WM_DDE_REQUEST      (WM_DDE_FIRST+6)
  181. #define WM_DDE_POKE             (WM_DDE_FIRST+7)
  182. #define WM_DDE_EXECUTE      (WM_DDE_FIRST+8)
  183. #define WM_DDE_LAST             (WM_DDE_FIRST+8)
  184.  
  185. /*----------------------------------------------------------------------------
  186. |       DDEACK structure
  187. |
  188. |       Structure of wStatus (LOWORD(lParam)) in WM_DDE_ACK message
  189. |       sent in response to a WM_DDE_DATA, WM_DDE_REQUEST, WM_DDE_POKE,
  190. |       WM_DDE_ADVISE, or WM_DDE_UNADVISE message.
  191. |
  192. ----------------------------------------------------------------------------*/
  193.  
  194. typedef struct {
  195.         unsigned short bAppReturnCode:8,
  196.                  reserved:6,
  197.                  fBusy:1,
  198.                  fAck:1;
  199. } DDEACK;
  200.  
  201.  
  202. /*----------------------------------------------------------------------------
  203. |       DDEADVISE structure
  204. |
  205. |       WM_DDE_ADVISE parameter structure for hOptions (LOWORD(lParam))
  206. |
  207. ----------------------------------------------------------------------------*/
  208.  
  209. typedef struct {
  210.         unsigned short reserved:14,
  211.                  fDeferUpd:1,
  212.                  fAckReq:1;
  213.         short     cfFormat;
  214. } DDEADVISE;
  215.  
  216.  
  217. /*----------------------------------------------------------------------------
  218. |       DDEDATA structure
  219. |
  220. |       WM_DDE_DATA parameter structure for hData (LOWORD(lParam)).
  221. |       The actual size of this structure depends on the size of
  222. |       the Value array.
  223. |
  224. ----------------------------------------------------------------------------*/
  225.  
  226. typedef struct {
  227.         unsigned short unused:12,
  228.                  fResponse:1,
  229.                  fRelease:1,
  230.                  reserved:1,
  231.                  fAckReq:1;
  232.         short    cfFormat;
  233.         BYTE     Value[1];
  234. } DDEDATA;
  235.  
  236.  
  237. /*----------------------------------------------------------------------------
  238. |       DDEPOKE structure
  239. |
  240. |       WM_DDE_POKE parameter structure for hData (LOWORD(lParam)).
  241. |       The actual size of this structure depends on the size of
  242. |       the Value array.
  243. |
  244. ----------------------------------------------------------------------------*/
  245.  
  246. typedef struct {
  247.         unsigned short unused:13,  /* Earlier versions of DDE.H incorrectly */
  248.                              /* 12 unused bits.                       */
  249.                  fRelease:1,
  250.                  fReserved:2;
  251.         short    cfFormat;
  252.         BYTE     Value[1];  /* This member was named rgb[1] in previous */
  253.                             /* versions of DDE.H                        */
  254.  
  255. } DDEPOKE;
  256.  
  257. /*----------------------------------------------------------------------------
  258. The following typedef's were used in previous versions of the Windows SDK.
  259. They are still valid.  The above typedef's define exactly the same structures
  260. as those below.  The above typedef names are recommended, however, as they
  261. are more meaningful.
  262.  
  263. Note that the DDEPOKE structure typedef'ed in earlier versions of DDE.H did
  264. not correctly define the bit positions.
  265. ----------------------------------------------------------------------------*/
  266.  
  267. typedef struct {
  268.         unsigned short unused:13,
  269.                  fRelease:1,
  270.                  fDeferUpd:1,
  271.                  fAckReq:1;
  272.         short    cfFormat;
  273. } DDELN;
  274.  
  275. typedef struct {
  276.         unsigned short unused:12,
  277.                  fAck:1,
  278.                  fRelease:1,
  279.                  fReserved:1,
  280.                  fAckReq:1;
  281.         short    cfFormat;
  282.         BYTE     rgb[1];
  283. } DDEUP;
  284.  
  285.  
  286. /*
  287.  * DDE SECURITY
  288.  */
  289.  
  290. BOOL
  291. WINAPI
  292. DdeSetQualityOfService(
  293.     HWND hwndClient,
  294.     CONST SECURITY_QUALITY_OF_SERVICE *pqosNew,
  295.     PSECURITY_QUALITY_OF_SERVICE pqosPrev);
  296.  
  297. BOOL
  298. WINAPI
  299. ImpersonateDdeClientWindow(
  300.     HWND hWndClient,
  301.     HWND hWndServer);
  302.  
  303. /*
  304.  * DDE message packing APIs
  305.  */
  306. LONG APIENTRY PackDDElParam(UINT msg, UINT uiLo, UINT uiHi);
  307. BOOL APIENTRY UnpackDDElParam(UINT msg, LONG lParam, PUINT puiLo, PUINT puiHi);
  308. BOOL APIENTRY FreeDDElParam(UINT msg, LONG lParam);
  309. LONG APIENTRY ReuseDDElParam(LONG lParam, UINT msgIn, UINT msgOut, UINT uiLo, UINT uiHi);
  310.  
  311. #endif  /* __FLAT__ */
  312.  
  313. #ifndef RC_INVOKED
  314. #pragma option -a.      /* Revert to default packing */
  315. #pragma warn .bbf       /* Revert to default warning about bitfields */
  316. #endif  /* RC_INVOKED */
  317.  
  318. #endif  /* __DDE_H */
  319.  
  320.