Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

283 lines
5.5 KiB

  1. /*****************************************************************************
  2. C L I P B O O K H E A D E R
  3. Name: clipbook.h
  4. Date: 21-Jan-1994
  5. Creator: Unknown
  6. Description:
  7. This is the header file for all files in clipview directory.
  8. History:
  9. 21-Jan-1994 John Fu, reformat, cleanup, and removed all externs.
  10. *****************************************************************************/
  11. #include <commdlg.h>
  12. #include <ddeml.h>
  13. #include <nddeapi.h>
  14. #include "clpbkrc.h"
  15. #include "vclpbrd.h"
  16. #define SetStatusBarText(x) if(hwndStatus)SendMessage(hwndStatus, SB_SETTEXT, 1, (LPARAM)(LPSTR)(x));
  17. /**********************
  18. Data structures
  19. **********************/
  20. /*
  21. * Per MDI client data
  22. */
  23. struct MdiInfo {
  24. HCONV hExeConv; // Used for sync transaction only
  25. HCONV hClpConv; // Used for async transaction only
  26. HSZ hszClpTopic;
  27. HSZ hszConvPartner;
  28. HSZ hszConvPartnerNP;
  29. HWND hWndListbox;
  30. WORD DisplayMode;
  31. WORD OldDisplayMode;
  32. DWORD flags;
  33. TCHAR szBaseName[ (MAX_COMPUTERNAME_LENGTH+1) * 2];
  34. TCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
  35. UINT CurSelFormat;
  36. LONG cyScrollLast;
  37. LONG cyScrollNow;
  38. int cxScrollLast;
  39. int cxScrollNow;
  40. RECT rcWindow;
  41. WORD cyLine, cxChar, cxMaxCharWidth; // Size of a standard text char
  42. WORD cxMargin, cyMargin; // White border size around clip data area
  43. BOOL fDisplayFormatChanged;
  44. PVCLPBRD pVClpbrd;
  45. HCONV hVClpConv;
  46. HSZ hszVClpTopic;
  47. // scrollbars, etc. for the paging control
  48. HWND hwndVscroll;
  49. HWND hwndHscroll;
  50. HWND hwndSizeBox;
  51. HWND hwndPgUp;
  52. HWND hwndPgDown;
  53. };
  54. typedef struct MdiInfo MDIINFO;
  55. typedef struct MdiInfo * PMDIINFO;
  56. typedef struct MdiInfo FAR * LPMDIINFO;
  57. /*
  58. * data request record
  59. */
  60. #define RQ_PREVBITMAP 10
  61. #define RQ_COPY 11
  62. #define RQ_SETPAGE 12
  63. #define RQ_EXECONV 13
  64. struct DataRequest_tag
  65. {
  66. WORD rqType; // one of above defines
  67. HWND hwndMDI;
  68. HWND hwndList;
  69. UINT iListbox;
  70. BOOL fDisconnect;
  71. WORD wFmt;
  72. WORD wRetryCnt;
  73. };
  74. typedef struct DataRequest_tag DATAREQ;
  75. typedef struct DataRequest_tag * PDATAREQ;
  76. /*
  77. * Owner draw listbox data structure
  78. */
  79. #define MAX_PAGENAME_LENGTH MAX_NDDESHARENAME
  80. struct ListEntry_tag
  81. {
  82. TCHAR name[MAX_PAGENAME_LENGTH + 1];
  83. HBITMAP hbmp;
  84. BOOL fDelete;
  85. BOOL fTriedGettingPreview;
  86. };
  87. typedef struct ListEntry_tag LISTENTRY;
  88. typedef struct ListEntry_tag * PLISTENTRY;
  89. typedef struct ListEntry_tag FAR * LPLISTENTRY;
  90. /*
  91. * Extra window data for MDI child registerclass
  92. * contains a pointer to above MDIINFO struct
  93. */
  94. #define GWL_MDIINFO 0
  95. #define CBWNDEXTRA sizeof(LONG_PTR)
  96. // per MDI window flags - used for MDIINFO.flags
  97. #define F_LOCAL 0x00000001
  98. #define F_CLPBRD 0x00000002
  99. // per MDI display mode - MDIINFO.DisplayMode
  100. #define DSP_LIST 10
  101. #define DSP_PREV 11
  102. #define DSP_PAGE 12
  103. /*
  104. * Data structure used to pass share info to SedCallback
  105. */
  106. typedef struct
  107. {
  108. SECURITY_INFORMATION si;
  109. WCHAR awchCName[MAX_COMPUTERNAME_LENGTH + 3];
  110. WCHAR awchSName[MAX_NDDESHARENAME + 1];
  111. }
  112. SEDCALLBACKCONTEXT;
  113. /*
  114. * Data structure passed to KeepAsDialogProc (Paste)
  115. */
  116. typedef struct
  117. {
  118. BOOL bAlreadyExist;
  119. BOOL bAlreadyShared;
  120. TCHAR ShareName[MAX_NDDESHARENAME +2];
  121. }
  122. KEEPASDLG_PARAM, *PKEEPASDLG_PARAM;
  123. /*************
  124. Macros
  125. *************/
  126. #define PRIVATE_FORMAT(fmt) ((fmt) >= 0xC000)
  127. #define GETMDIINFO(x) (x? (PMDIINFO)(GetWindowLongPtr((x),GWL_MDIINFO)): NULL)
  128. // parameter codes for MyGetFormat()
  129. #define GETFORMAT_LIE 200
  130. #define GETFORMAT_DONTLIE 201
  131. // default DDEML synchronous transaction timeouts
  132. // note these should be generous
  133. #define SHORT_SYNC_TIMEOUT (24L*1000L)
  134. #define LONG_SYNC_TIMEOUT (60L*1000L)
  135. // owner draw listbox and bitmap metrics constants
  136. #define LSTBTDX 16 // width of folder ( with or without hand )
  137. #define LSTBTDY 16 // height of folder ( with or without hand )
  138. #define SHR_PICT_X 0 // offsets of shared folder bitmap
  139. #define SHR_PICT_Y 0
  140. #define SAV_PICT_X 16 // offsets of non-shared folder bitmap
  141. #define SAV_PICT_Y 0
  142. #define PREVBRD 4 // border around preview bitmaps
  143. #define BTNBARBORDER 2
  144. #define DEF_WIDTH 400 // initial app size
  145. #define DEF_HEIGHT 300
  146. #define SZBUFSIZ MAX_DDE_EXEC
  147. #define ARRAYSIZE(a) (sizeof(a)/sizeof((a)[0]))
  148. // combined styles for owner draw listbox variants
  149. #define LBS_LISTVIEW (LBS_OWNERDRAWFIXED|LBS_DISABLENOSCROLL)
  150. #define LBS_PREVIEW (LBS_MULTICOLUMN|LBS_OWNERDRAWFIXED)
  151. //////////// compile options //////////////
  152. #define MAX_ALLOWED_PAGES 127
  153. #define WINDOW_MENU_INDEX 4
  154. #define DISPLAY_MENU_INDEX 3 // submenu to put format entries i.e. "&Text"
  155. #define SECURITY_MENU_INDEX 2