Annotation of mstools/samples/ddeml/client/client.h, revision 1.1.1.2

1.1       root        1: #include <windows.h>
                      2: #include <ddeml.h>
                      3: 
                      4: #define WINDOWMENU  3  /* position of window menu               */
                      5: 
                      6: /* resource ID's */
                      7: #define IDCLIENT  1
                      8: #define IDCONV   2
                      9: #define IDLIST   3
                     10: 
                     11: 
                     12: /* menu ID's */
                     13: 
                     14: #define IDM_EDITPASTE          2004
                     15: 
                     16: #define IDM_CONNECT             3000    // enabled always
                     17: #define IDM_RECONNECT           3001    // enabled if list selected
                     18: #define IDM_DISCONNECT          3002    // enabled if conversation selected
                     19: #define IDM_TRANSACT            3003    // enabled if conversation selected
                     20: #define IDM_ABANDON             3004    // enabled if transaction selected
                     21: #define IDM_ABANDONALL          3005    // enabled if conv. selected &&
                     22:                                         // and any transaction windows exist
                     23: 
                     24: #define IDM_BLOCKCURRENT        3010    // enabled if conv. sel.  chkd if conv. blocked
                     25: #define IDM_ENABLECURRENT       3011    // enabled if conv. sel.  chkd if not blocked
                     26: #define IDM_ENABLEONECURRENT    3012    // enabled if conv. sel.
                     27: 
                     28: #define IDM_BLOCKALLCBS         3013    // enabled if any convs.
                     29: #define IDM_ENABLEALLCBS        3014    // enabled if any convs.
                     30: #define IDM_ENABLEONECB         3015    // enabled if any convs.
                     31: 
                     32: #define IDM_BLOCKNEXTCB         3016    // enabled always, chkd if set.
                     33: #define IDM_TERMNEXTCB          3017    // enabled if any convs.  chked if set.
                     34: 
                     35: #define IDM_TIMEOUT             3021
                     36: #define IDM_DELAY               3022
                     37: #define IDM_CONTEXT             3023
                     38: #define IDM_AUTORECONNECT       3024
                     39: 
                     40: #define IDM_WINDOWTILE         4001
                     41: #define IDM_WINDOWCASCADE       4002
                     42: #define IDM_WINDOWCLOSEALL      4003
                     43: #define IDM_WINDOWICONS         4004
                     44: 
                     45: #define IDM_XACTTILE           4005
                     46: #define IDM_XACTCASCADE         4006
                     47: #define IDM_XACTCLOSEALL        4007
                     48: 
                     49: #define IDM_WINDOWCHILD         4100
                     50: 
                     51: #define IDM_HELP               5001
                     52: #define IDM_HELPABOUT          5002
                     53: 
                     54: 
                     55: #define DEFTIMEOUT              1000
                     56: 
                     57: #include "dialog.h"
                     58: 
                     59: // predefined format list item
                     60: 
                     61: typedef struct {
                     62:     DWORD fmt;
                     63:     PSTR sz;
                     64: } FORMATINFO;
                     65: #define CFORMATS 3
                     66: 
                     67: // conversation (MDI child) window information
                     68: typedef struct {
                     69:     HWND hwndXaction;       // last xaction window with focus, 0 if none.
                     70:     BOOL fList;
                     71:     HCONV hConv;
                     72:     HSZ hszTopic;
                     73:     HSZ hszApp;
                     74:     INT x;          // next child coord.
                     75:     INT y;
                     76:     CONVINFO ci; // most recent status info.
                     77: } MYCONVINFO;       // parameters to AddConv() in reverse order.
                     78: #define CHILDCBWNDEXTRA            sizeof(HWND)
                     79: #define UM_GETNEXTCHILDX    (WM_USER + 200)
                     80: #define UM_GETNEXTCHILDY    (WM_USER + 201)
                     81: #define UM_DISCONNECTED     (WM_USER + 202)
                     82: 
                     83: // transaction processing structure - this structure is associated with
                     84: // infoctrl control windows.  A handle to this structure is placed into
                     85: // the first window word of the control.
                     86: typedef struct {    // used to passinfo to/from TransactionDlgProc and
                     87:     DWORD ret;      // TextEntryDlgProc.
                     88:     DWORD Result;
                     89:     DWORD ulTimeout;
                     90:     DWORD wType;
                     91:     HCONV hConv;
                     92:     HDDEDATA hDdeData;
                     93:     DWORD wFmt;
                     94:     HSZ hszItem;
                     95:     DWORD fsOptions;
                     96: } XACT;
                     97: 
                     98: typedef struct {
                     99:     HDDEDATA hData;
                    100:     HSZ hszItem;
                    101:     DWORD wFmt;
                    102: } OWNED;
                    103: 
                    104: // transaction option flags - for fsOptions field and DefOptions global.
                    105: 
                    106: #define XOPT_NODATA             0x0001
                    107: #define XOPT_ACKREQ             0x0002
                    108: #define XOPT_DISABLEFIRST       0x0004
                    109: #define XOPT_ABANDONAFTERSTART  0x0008
                    110: #define XOPT_BLOCKRESULT        0x0010
                    111: #define XOPT_ASYNC              0x0020
                    112: #define XOPT_COMPLETED          0x8000      // used internally only.
                    113: 
                    114: /* strings */
                    115: #define IDS_ILLFNM             1
                    116: #define IDS_ADDEXT             2
                    117: #define IDS_CLOSESAVE      3
                    118: #define IDS_HELPNOTAVAIL    4
                    119: #define IDS_CLIENTTITLE     5
                    120: #define IDS_APPNAME            6
                    121: #define IDS_DDEMLERR        7
                    122: #define IDS_BADLENGTH       8
                    123: 
                    124: /* attribute flags for DlgDirList */
                    125: #define ATTR_DIRS      0xC010          /* find drives and directories */
                    126: #define ATTR_FILES     0x0000          /* find ordinary files         */
                    127: #define PROP_FILENAME  szPropertyName  /* name of property for dialog */
                    128: #define MAX_OWNED   20
                    129: 
                    130: /*
                    131:  *  GLOBALS
                    132:  */
                    133: extern CONVCONTEXT CCFilter;
                    134: extern DWORD idInst;
                    135: extern HANDLE hInst;           /* application instance handle            */
                    136: extern HANDLE hAccel;          /* resource handle of accelerators        */
                    137: extern HWND hwndFrame;         /* main window handle                     */
                    138: extern HWND hwndMDIClient;     /* handle of MDI Client window            */
                    139: extern HWND hwndActive;        /* handle of current active MDI child     */
                    140: extern HWND hwndActiveEdit;    /* handle of edit control in active child */
                    141: extern LONG styleDefault;      /* default child creation state           */
                    142: extern DWORD SyncTimeout;
                    143: extern LONG DefTimeout;
                    144: extern DWORD wDelay;
                    145: extern BOOL fEnableCBs;
                    146: extern BOOL fEnableOneCB;
                    147: extern BOOL fBlockNextCB;
                    148: extern BOOL fTermNextCB;
                    149: extern BOOL fAutoReconnect;
                    150: extern HDDEDATA hDataOwned;
                    151: extern DWORD fmtLink;        // registered LINK clipboard fmt
                    152: extern DWORD DefOptions;
                    153: extern CHAR szChild[];         /* class of child                         */
                    154: extern CHAR szList[];          /* class of child                         */
                    155: extern CHAR szSearch[];        /* search string                          */
                    156: extern CHAR *szDriver;         /* name of printer driver                 */
                    157: extern CHAR szPropertyName[];  /* filename property for dialog box       */
                    158: extern INT iPrinter;           /* level of printing capability           */
                    159: extern BOOL fCase;             /* searches case sensitive                */
                    160: extern DWORD cFonts;           /* number of fonts enumerated             */
                    161: extern FORMATINFO aFormats[];
                    162: extern OWNED aOwned[MAX_OWNED];
                    163: extern DWORD cOwned;
                    164: extern FARPROC lpMsgFilterProc;
1.1.1.2 ! root      165: extern HSZ hszHuge;
        !           166: extern HHOOK ghhk;
1.1       root      167: 
                    168: 
                    169: // MACROS
                    170: 
                    171: #ifdef NODEBUG
                    172: #define MyAlloc(cb)     (PSTR)LocalAlloc(LPTR, (cb))
                    173: #define MyFree(p)       (LocalUnlock((HANDLE)(p)), LocalFree((HANDLE)(p)))
                    174: #else   // DEBUG
                    175: 
                    176: #define MyAlloc(cb)     DbgAlloc((DWORD)cb)
                    177: #define MyFree(p)       DbgFree((PSTR)p)
                    178: #endif //NODEBUG
                    179: 
                    180: 
                    181: /*  externally declared functions
                    182:  */
                    183: 
                    184: // client.c
                    185: 
                    186: BOOL  APIENTRY InitializeApplication(VOID);
                    187: BOOL  APIENTRY InitializeInstance(DWORD);
                    188: INT FAR cdecl MPError(DWORD,DWORD,...);
                    189: LONG  APIENTRY FrameWndProc(HWND, UINT, WPARAM, LPARAM);
                    190: LONG  APIENTRY MDIChildWndProc(HWND, UINT, WPARAM, LPARAM);
                    191: HCONV CreateConv(HSZ hszApp, HSZ hszTopic, BOOL fList);
                    192: HWND  APIENTRY AddConv(HSZ hszApp, HSZ hszTopic, HCONV hConv, BOOL fList);
                    193: PSTR GetConvListText(HCONVLIST hConvList);
                    194: PSTR GetConvInfoText(HCONV hConv, CONVINFO *pci);
                    195: PSTR GetConvTitleText(HCONV hConv, HSZ hszApp, HSZ hszTopic, BOOL fList);
                    196: PSTR Status2String(DWORD status);
                    197: PSTR State2String(DWORD state);
                    198: PSTR Error2String(DWORD error);
                    199: PSTR Type2String(DWORD wType, DWORD fsOptions);
                    200: PSTR GetHSZName(HSZ hsz);
1.1.1.2 ! root      201: LRESULT CALLBACK MyMsgFilterProc(int nCode, WPARAM wParam, LPARAM lParam);
1.1       root      202: 
                    203: // dialog.c
                    204: 
                    205: 
1.1.1.2 ! root      206: INT FAR DoDialog(LPSTR lpTemplateName, DLGPROC lpDlgProc, LONG param,
1.1       root      207:         BOOL fRememberFocus);
                    208: BOOL  APIENTRY AboutDlgProc(HWND, UINT, WPARAM, LPARAM);
                    209: BOOL  APIENTRY ConnectDlgProc(HWND, UINT, WPARAM, LPARAM);
                    210: BOOL  APIENTRY TransactDlgProc(HWND, UINT, WPARAM, LPARAM);
                    211: BOOL  APIENTRY AdvOptsDlgProc(HWND, UINT, WPARAM, LPARAM);
                    212: BOOL  APIENTRY TextEntryDlgProc(HWND, UINT, WPARAM, LPARAM);
                    213: BOOL  APIENTRY ViewHandleDlgProc(HWND, UINT, WPARAM, LPARAM);
                    214: BOOL  APIENTRY TimeoutDlgProc(HWND, UINT, WPARAM, LPARAM);
                    215: BOOL  APIENTRY DelayDlgProc(HWND, UINT, WPARAM, LPARAM);
                    216: BOOL  APIENTRY ContextDlgProc(HWND, UINT, WPARAM, LPARAM);
                    217: VOID Delay(DWORD delay);
                    218: 
                    219: // dde.c
                    220: 
                    221: 
                    222: BOOL ProcessTransaction(XACT *pxact);
                    223: VOID CompleteTransaction(HWND hwndInfoCtr, XACT *pxact);
                    224: HDDEDATA CALLBACK DdeCallback(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1,
                    225:         HSZ hsz2, HDDEDATA hData, DWORD lData1, DWORD lData2);
                    226: HWND MDIChildFromhConv(HCONV hConv);
                    227: HWND FindAdviseChild(HWND hwndMDI, HSZ hszItem, DWORD wFmt);
                    228: HWND FindListWindow(HCONVLIST hConvList);
                    229: PSTR GetTextData(HDDEDATA hData);
                    230: PSTR GetFormatData(HDDEDATA hData);
                    231: INT MyGetClipboardFormatName(DWORD fmt, LPSTR lpstr, INT cbMax);
                    232: PSTR GetFormatName(DWORD wFmt);
                    233: BOOL MyDisconnect(HCONV hConv);
                    234: 
                    235: // mem.c
                    236: 
                    237: 
                    238: PSTR DbgAlloc(DWORD cb);
                    239: PSTR DbgFree(PSTR p);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.