home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / dde.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  5KB  |  192 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * dde.h -       Dynamic Data Exchange structures and definitions              *
  4. *                                                                             *
  5. * Copyright 1993 - 1998 Microsoft Corp.    All rights reserved          *
  6. *                                                                             *
  7. \*****************************************************************************/
  8. #ifndef _DDEHEADER_INCLUDED_
  9. #define _DDEHEADER_INCLUDED_
  10.  
  11. #ifndef _WINDEF_
  12. #include <windef.h>
  13. #endif
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. // begin_r_dde
  20.  
  21. /* DDE window messages */
  22.  
  23. #define WM_DDE_FIRST        0x03E0
  24. #define WM_DDE_INITIATE     (WM_DDE_FIRST)
  25. #define WM_DDE_TERMINATE    (WM_DDE_FIRST+1)
  26. #define WM_DDE_ADVISE        (WM_DDE_FIRST+2)
  27. #define WM_DDE_UNADVISE     (WM_DDE_FIRST+3)
  28. #define WM_DDE_ACK            (WM_DDE_FIRST+4)
  29. #define WM_DDE_DATA            (WM_DDE_FIRST+5)
  30. #define WM_DDE_REQUEST        (WM_DDE_FIRST+6)
  31. #define WM_DDE_POKE            (WM_DDE_FIRST+7)
  32. #define WM_DDE_EXECUTE        (WM_DDE_FIRST+8)
  33. #define WM_DDE_LAST            (WM_DDE_FIRST+8)
  34.  
  35. // end_r_dde
  36.  
  37. /*----------------------------------------------------------------------------
  38. |       DDEACK structure
  39. |
  40. |    Structure of wStatus (LOWORD(lParam)) in WM_DDE_ACK message
  41. |       sent in response to a WM_DDE_DATA, WM_DDE_REQUEST, WM_DDE_POKE,
  42. |       WM_DDE_ADVISE, or WM_DDE_UNADVISE message.
  43. |
  44. ----------------------------------------------------------------------------*/
  45.  
  46. typedef struct {
  47. #ifndef _MAC
  48.         unsigned short bAppReturnCode:8,
  49.                  reserved:6,
  50.                  fBusy:1,
  51.          fAck:1;
  52. #else
  53.         unsigned short usFlags;
  54. #endif
  55. } DDEACK;
  56.  
  57.  
  58. /*----------------------------------------------------------------------------
  59. |       DDEADVISE structure
  60. |
  61. |    WM_DDE_ADVISE parameter structure for hOptions (LOWORD(lParam))
  62. |
  63. ----------------------------------------------------------------------------*/
  64.  
  65. typedef struct {
  66. #ifndef _MAC
  67.         unsigned short reserved:14,
  68.                  fDeferUpd:1,
  69.          fAckReq:1;
  70. #else
  71.         unsigned short usFlags;
  72. #endif
  73.     short     cfFormat;
  74. } DDEADVISE;
  75.  
  76.  
  77. /*----------------------------------------------------------------------------
  78. |       DDEDATA structure
  79. |
  80. |       WM_DDE_DATA parameter structure for hData (LOWORD(lParam)).
  81. |       The actual size of this structure depends on the size of
  82. |       the Value array.
  83. |
  84. ----------------------------------------------------------------------------*/
  85.  
  86. typedef struct {
  87. #ifndef _MAC
  88.     unsigned short unused:12,
  89.                  fResponse:1,
  90.                  fRelease:1,
  91.                  reserved:1,
  92.                  fAckReq:1;
  93. #else
  94.     unsigned short usFlags;
  95. #endif
  96.     short     cfFormat;
  97.     BYTE     Value[1];
  98. } DDEDATA;
  99.  
  100.  
  101. /*----------------------------------------------------------------------------
  102. |    DDEPOKE structure
  103. |
  104. |    WM_DDE_POKE parameter structure for hData (LOWORD(lParam)).
  105. |       The actual size of this structure depends on the size of
  106. |       the Value array.
  107. |
  108. ----------------------------------------------------------------------------*/
  109.  
  110. typedef struct {
  111. #ifndef _MAC
  112.     unsigned short unused:13,  /* Earlier versions of DDE.H incorrectly */
  113.                              /* 12 unused bits.                       */
  114.          fRelease:1,
  115.          fReserved:2;
  116. #else
  117.     unsigned short usFlags;
  118. #endif
  119.     short    cfFormat;
  120.     BYTE     Value[1];  /* This member was named rgb[1] in previous */
  121.                             /* versions of DDE.H                        */
  122.  
  123. } DDEPOKE;
  124.  
  125. /*----------------------------------------------------------------------------
  126. The following typedef's were used in previous versions of the Windows SDK.
  127. They are still valid.  The above typedef's define exactly the same structures
  128. as those below.  The above typedef names are recommended, however, as they
  129. are more meaningful.
  130.  
  131. Note that the DDEPOKE structure typedef'ed in earlier versions of DDE.H did
  132. not correctly define the bit positions.
  133. ----------------------------------------------------------------------------*/
  134.  
  135. typedef struct {
  136. #ifndef _MAC
  137.         unsigned short unused:13,
  138.                  fRelease:1,
  139.                  fDeferUpd:1,
  140.          fAckReq:1;
  141. #else
  142.     unsigned short usFlags;
  143. #endif
  144.     short     cfFormat;
  145. } DDELN;
  146.  
  147. typedef struct {
  148. #ifndef _MAC
  149.     unsigned short unused:12,
  150.                  fAck:1,
  151.                  fRelease:1,
  152.                  fReserved:1,
  153.                  fAckReq:1;
  154. #else
  155.     unsigned short usFlags;
  156. #endif
  157.     short     cfFormat;
  158.     BYTE     rgb[1];
  159. } DDEUP;
  160.  
  161.  
  162. /*
  163.  * DDE SECURITY
  164.  */
  165.  
  166. BOOL
  167. WINAPI
  168. DdeSetQualityOfService(
  169.     HWND hwndClient,
  170.     CONST SECURITY_QUALITY_OF_SERVICE *pqosNew,
  171.     PSECURITY_QUALITY_OF_SERVICE pqosPrev);
  172.  
  173. BOOL
  174. WINAPI
  175. ImpersonateDdeClientWindow(
  176.     HWND hWndClient,
  177.     HWND hWndServer);
  178.  
  179. /*
  180.  * DDE message packing APIs
  181.  */
  182. LONG APIENTRY PackDDElParam(UINT msg, UINT uiLo, UINT uiHi);
  183. BOOL APIENTRY UnpackDDElParam(UINT msg, LONG lParam, PUINT puiLo, PUINT puiHi);
  184. BOOL APIENTRY FreeDDElParam(UINT msg, LONG lParam);
  185. LONG APIENTRY ReuseDDElParam(LONG lParam, UINT msgIn, UINT msgOut, UINT uiLo, UINT uiHi);
  186.  
  187. #ifdef __cplusplus
  188. }
  189. #endif
  190.  
  191. #endif // _DDEHEADER_INCLUDED_
  192.