module win32.ansi.dde;

// Translated from Microsoft Platform SDK August 2001 Edition
// by Y.Tomino (demoonlit@inter7.jp)


// #ifndef _DDEHEADER_INCLUDED_
// #define _DDEHEADER_INCLUDED_

// #if _MSC_VER > 1000
// #pragma once
// #endif

// #ifndef _WINDEF_
import win32.ansi.windef;
// #endif

// #ifdef __cplusplus
// extern "C" {
// #endif

enum : uint { WM_DDE_FIRST = 0x03E0 }
enum : uint { WM_DDE_INITIATE = WM_DDE_FIRST }
enum : uint { WM_DDE_TERMINATE = WM_DDE_FIRST+1 }
enum : uint { WM_DDE_ADVISE = WM_DDE_FIRST+2 }
enum : uint { WM_DDE_UNADVISE = WM_DDE_FIRST+3 }
enum : uint { WM_DDE_ACK = WM_DDE_FIRST+4 }
enum : uint { WM_DDE_DATA = WM_DDE_FIRST+5 }
enum : uint { WM_DDE_REQUEST = WM_DDE_FIRST+6 }
enum : uint { WM_DDE_POKE = WM_DDE_FIRST+7 }
enum : uint { WM_DDE_EXECUTE = WM_DDE_FIRST+8 }
enum : uint { WM_DDE_LAST = WM_DDE_FIRST+8 }

struct _0 {
// #ifndef _MAC
// unsigned short bAppReturnCode:8,
// reserved:6,
// fBusy:1,
// fAck:1;
// #else
// ...
// #endif
}
alias _0 DDEACK;

struct _1 {
// #ifndef _MAC
// unsigned short reserved:14,
// fDeferUpd:1,
// fAckReq:1;
// #else
// ...
// #endif
  short cfFormat;
}
alias _1 DDEADVISE;

struct _2 {
// #ifndef _MAC
// unsigned short unused:12,
// fResponse:1,
// fRelease:1,
// reserved:1,
// fAckReq:1;
// #else
// ...
// #endif
  short cfFormat;
  BYTE Value[1];
}
alias _2 DDEDATA;

struct _3 {
// #ifndef _MAC
// unsigned short unused:13,

// fRelease:1,
// fReserved:2;
// #else
// ...
// #endif
  short cfFormat;
  BYTE Value[1];

}
alias _3 DDEPOKE;

struct _4 {
// #ifndef _MAC
// unsigned short unused:13,
// fRelease:1,
// fDeferUpd:1,
// fAckReq:1;
// #else
// ...
// #endif
  short cfFormat;
}
alias _4 DDELN;

struct _5 {
// #ifndef _MAC
// unsigned short unused:12,
// fAck:1,
// fRelease:1,
// fReserved:1,
// fAckReq:1;
// #else
// ...
// #endif
  short cfFormat;
  BYTE rgb[1];
}
alias _5 DDEUP;

extern(Windows) export BOOL DdeSetQualityOfService(
  HWND hwndClient,
  SECURITY_QUALITY_OF_SERVICE *pqosNew,
  PSECURITY_QUALITY_OF_SERVICE pqosPrev);

extern(Windows) export BOOL ImpersonateDdeClientWindow(
  HWND hWndClient,
  HWND hWndServer);

extern(Windows) export LPARAM PackDDElParam(UINT msg, UINT_PTR uiLo, UINT_PTR uiHi);
extern(Windows) export BOOL UnpackDDElParam(UINT msg, LPARAM lParam, PUINT_PTR puiLo, PUINT_PTR puiHi);
extern(Windows) export BOOL FreeDDElParam(UINT msg, LPARAM lParam);
extern(Windows) export LPARAM ReuseDDElParam(LPARAM lParam, UINT msgIn, UINT msgOut, UINT_PTR uiLo, UINT_PTR uiHi);

// #ifdef __cplusplus
// }
// #endif

// #endif // _DDEHEADER_INCLUDED_
