📄 ddeml.h
字号:
/*****************************************************************************\
* *
* ddeml.h - DDEML API header file *
* *
* Version 1.0 *
* *
\*****************************************************************************/
#ifndef __DDEML_H /* prevent multiple includes */
#define __DDEML_H
#ifndef __WINDOWS_H
#include <windows.h> /* <windows.h> must be included */
#endif /* __WINDOWS_H */
#ifndef RC_INVOKED
#pragma option -a- /* Assume byte packing throughout */
#endif /* RC_INVOKED */
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
/* If included with the 3.0 windows.h, define compatible aliases */
#if !defined(WINVER) || (WINVER < 0x030a)
#define LPCSTR LPSTR
#define WINAPI FAR PASCAL
#define CALLBACK FAR PASCAL
#define UINT WORD
#define LPARAM LONG
#define WPARAM WORD
#define LRESULT LONG
#define HMODULE HANDLE
#define HINSTANCE HANDLE
#define HLOCAL HANDLE
#define HGLOBAL HANDLE
#endif /* WIN3.0 */
#ifndef DECLARE_HANDLE32
#ifdef STRICT
#define DECLARE_HANDLE32(name) struct name##__ { int unused; }; \
typedef const struct name##__ _far* name
#else /* STRICT */
#define DECLARE_HANDLE32(name) typedef DWORD name
#endif /* !STRICT */
#endif /* !DECLARE_HANDLE32 */
#define EXPENTRY WINAPI
/******** public types ********/
DECLARE_HANDLE32(HCONVLIST);
DECLARE_HANDLE32(HCONV);
DECLARE_HANDLE32(HSZ);
DECLARE_HANDLE32(HDDEDATA);
/* the following structure is for use with XTYP_WILDCONNECT processing. */
typedef struct tagHSZPAIR
{
HSZ hszSvc;
HSZ hszTopic;
} HSZPAIR;
typedef HSZPAIR FAR *PHSZPAIR;
/* The following structure is used by DdeConnect() and DdeConnectList() and
by XTYP_CONNECT and XTYP_WILDCONNECT callbacks. */
typedef struct tagCONVCONTEXT
{
UINT cb; /* set to sizeof(CONVCONTEXT) */
UINT wFlags; /* none currently defined. */
UINT wCountryID; /* country code for topic/item strings used. */
int iCodePage; /* codepage used for topic/item strings. */
DWORD dwLangID; /* language ID for topic/item strings. */
DWORD dwSecurity; /* Private security code. */
} CONVCONTEXT;
typedef CONVCONTEXT FAR *PCONVCONTEXT;
/* The following structure is used by DdeQueryConvInfo(): */
typedef struct tagCONVINFO
{
DWORD cb; /* sizeof(CONVINFO) */
DWORD hUser; /* user specified field */
HCONV hConvPartner; /* hConv on other end or 0 if non-ddemgr partner */
HSZ hszSvcPartner; /* app name of partner if obtainable */
HSZ hszServiceReq; /* AppName requested for connection */
HSZ hszTopic; /* Topic name for conversation */
HSZ hszItem; /* transaction item name or NULL if quiescent */
UINT wFmt; /* transaction format or NULL if quiescent */
UINT wType; /* XTYP_ for current transaction */
UINT wStatus; /* ST_ constant for current conversation */
UINT wConvst; /* XST_ constant for current transaction */
UINT wLastError; /* last transaction error. */
HCONVLIST hConvList; /* parent hConvList if this conversation is in a list */
CONVCONTEXT ConvCtxt; /* conversation context */
} CONVINFO;
typedef CONVINFO FAR *PCONVINFO;
/***** conversation states (usState) *****/
#define XST_NULL 0 /* quiescent states */
#define XST_INCOMPLETE 1
#define XST_CONNECTED 2
#define XST_INIT1 3 /* mid-initiation states */
#define XST_INIT2 4
#define XST_REQSENT 5 /* active conversation states */
#define XST_DATARCVD 6
#define XST_POKESENT 7
#define XST_POKEACKRCVD 8
#define XST_EXECSENT 9
#define XST_EXECACKRCVD 10
#define XST_ADVSENT 11
#define XST_UNADVSENT 12
#define XST_ADVACKRCVD 13
#define XST_UNADVACKRCVD 14
#define XST_ADVDATASENT 15
#define XST_ADVDATAACKRCVD 16
/* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */
#define CADV_LATEACK 0xFFFF
/***** conversation status bits (fsStatus) *****/
#define ST_CONNECTED 0x0001
#define ST_ADVISE 0x0002
#define ST_ISLOCAL 0x0004
#define ST_BLOCKED 0x0008
#define ST_CLIENT 0x0010
#define ST_TERMINATED 0x0020
#define ST_INLIST 0x0040
#define ST_BLOCKNEXT 0x0080
#define ST_ISSELF 0x0100
/* DDE constants for wStatus field */
#define DDE_FACK 0x8000
#define DDE_FBUSY 0x4000
#define DDE_FDEFERUPD 0x4000
#define DDE_FACKREQ 0x8000
#define DDE_FRELEASE 0x2000
#define DDE_FREQUESTED 0x1000
#define DDE_FACKRESERVED 0x3ff0
#define DDE_FADVRESERVED 0x3fff
#define DDE_FDATRESERVED 0x4fff
#define DDE_FPOKRESERVED 0xdfff
#define DDE_FAPPSTATUS 0x00ff
#define DDE_FNOTPROCESSED 0x0000
/***** message filter hook types *****/
#define MSGF_DDEMGR 0x8001
/***** codepage constants ****/
#define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */
/***** transaction types *****/
#define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */
#define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */
#define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */
#define XCLASS_MASK 0xFC00
#define XCLASS_BOOL 0x1000
#define XCLASS_DATA 0x2000
#define XCLASS_FLAGS 0x4000
#define XCLASS_NOTIFICATION 0x8000
#define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
#define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS )
#define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK )
#define XTYP_ADVSTART (0x0030 | XCLASS_BOOL )
#define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION)
#define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS )
#define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
#define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
#define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION )
#define XTYP_POKE (0x0090 | XCLASS_FLAGS )
#define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
#define XTYP_REQUEST (0x00B0 | XCLASS_DATA )
#define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
#define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
#define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
#define XTYP_MASK 0x00F0
#define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */
/***** Timeout constants *****/
#define TIMEOUT_ASYNC -1L
/***** Transaction ID constants *****/
#define QID_SYNC -1L
/****** public strings used in DDE ******/
#define SZDDESYS_TOPIC "System"
#define SZDDESYS_ITEM_TOPICS "Topics"
#define SZDDESYS_ITEM_SYSITEMS "SysItems"
#define SZDDESYS_ITEM_RTNMSG "ReturnMessage"
#define SZDDESYS_ITEM_STATUS "Status"
#define SZDDESYS_ITEM_FORMATS "Formats"
#define SZDDESYS_ITEM_HELP "Help"
#define SZDDE_ITEM_ITEMLIST "TopicItemList"
/****** API entry points ******/
typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType, UINT wFmt, HCONV hConv,
HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2);
typedef FNCALLBACK *PFNCALLBACK;
#define CBR_BLOCK 0xffffffffL
/* DLL registration functions */
UINT WINAPI DdeInitialize(DWORD FAR* pidInst, PFNCALLBACK pfnCallback,
DWORD afCmd, DWORD ulRes);
/*
* Callback filter flags for use with standard apps.
*/
#define CBF_FAIL_SELFCONNECTIONS 0x00001000
#define CBF_FAIL_CONNECTIONS 0x00002000
#define CBF_FAIL_ADVISES 0x00004000
#define CBF_FAIL_EXECUTES 0x00008000
#define CBF_FAIL_POKES 0x00010000
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -