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.

186 lines
5.0 KiB

  1. /*****************************************************************************
  2. C O M M O N H E A D E R
  3. Name: common.h
  4. Date: 19-Apr-1994
  5. Creator: John Fu
  6. Description:
  7. This is the header common to clipview and datasrv.
  8. *****************************************************************************/
  9. #define PREVBMPSIZ 64 // dim of preview bitmap ( x and y )
  10. // non localized control strings common to Clipsrv.exe and clipbrd.exe
  11. #define SZ_SRV_NAME "ClipSrv"
  12. #define SZ_FORMAT_LIST TEXT("FormatList")
  13. #define SZCMD_INITSHARE TEXT("[initshare]")
  14. #define SZCMD_EXIT TEXT("[exit]")
  15. #define SZCMD_PASTESHARE TEXT("[pasteshare]")
  16. #define SZCMD_DELETE TEXT("[delete]")
  17. #define SZCMD_SHARE TEXT("[markshared]")
  18. #define SZCMD_UNSHARE TEXT("[markunshared]")
  19. #define SZCMD_PASTE TEXT("[paste]")
  20. #define SZCMD_SAVEAS TEXT("[saveas]")
  21. #define SZCMD_OPEN TEXT("[open]")
  22. #define SZCMD_DEBUG TEXT("[debug]")
  23. #define MAX_CMD_LEN 30
  24. #define MAX_DDE_EXEC (MAX_PATH +MAX_CMD_LEN +1)
  25. // These commands are new for NT clipbook.
  26. ///////////////////////////////////////////////////////////////////////
  27. // Requesting for error code after an XTYP_EXECUTE xtransaction
  28. #define SZ_ERR_REQUEST TEXT("ErrorRequest")
  29. #define XERRT_MASK 0xF0 // use to mask the XERR types
  30. #define XERRT_SYS 0x10 // XERR type, a GetLastError error code
  31. #define XERRT_NDDE 0x20 // XERR type, a NDde error code
  32. #define XERRT_DDE 0x30 // XERR type, a DDE error code
  33. #define XERR_FORMAT "%x %x" // XERR format string, "error_type error_code"
  34. // Save clipbrd file in Win 3.1 format
  35. #define SZCMD_SAVEASOLD TEXT("[saveasold]")
  36. // Version request - NT product 1 clipsrv will return 0x3010
  37. #define SZCMD_VERSION TEXT("[Version]")
  38. // Security information
  39. #define SZCMD_SECURITY TEXT("[Security]")
  40. #define SHR_CHAR TEXT('$')
  41. #define UNSHR_CHAR TEXT('*')
  42. #define BOGUS_CHAR TEXT('?')
  43. #define SZPREVNAME TEXT("Clipbook Preview")
  44. #define SZLINK TEXT("Link")
  45. #define SZLINKCOPY TEXT("LnkCpy")
  46. #define SZOBJECTLINK TEXT("ObjectLink")
  47. #define SZOBJECTLINKCOPY TEXT("ObjLnkCpy")
  48. #define LSZOBJECTLINK L"ObjectLink"
  49. #define LSZLINK L"Link"
  50. // The viewer and the server use this mutex name to avoid opening
  51. // the clipboard at the same time.
  52. #define SZMUTEXCLP TEXT("ClipbrdMutex")
  53. // The Common globals
  54. extern HINSTANCE hInst;
  55. extern UINT cf_preview;
  56. extern HWND hwndApp;
  57. // added for winball - clausgi
  58. extern UINT cf_link;
  59. extern UINT cf_objectlink;
  60. extern UINT cf_linkcopy;
  61. extern UINT cf_objectlinkcopy;
  62. // end additions
  63. #define PRIVATE_FORMAT(fmt) ((fmt) >= 0xC000)
  64. #define CCHFMTNAMEMAX 79 /* Longest clipboard data fmt name, including
  65. terminator */
  66. /* Structures for saving/loading clipboard data from disk */
  67. #define CLP_ID 0xC350
  68. #define CLP_NT_ID 0xC351
  69. #define CLPBK_NT_ID 0xC352
  70. typedef struct
  71. {
  72. WORD magic;
  73. WORD FormatCount;
  74. } FILEHEADER;
  75. // Format header
  76. typedef struct
  77. {
  78. DWORD FormatID;
  79. DWORD DataLen;
  80. DWORD DataOffset;
  81. WCHAR Name[CCHFMTNAMEMAX];
  82. } FORMATHEADER;
  83. // Windows 3.1-type structures - Win31 packed on byte boundaries.
  84. #pragma pack(1)
  85. typedef struct
  86. {
  87. WORD FormatID;
  88. DWORD DataLen;
  89. DWORD DataOffset;
  90. char Name[CCHFMTNAMEMAX];
  91. } OLDFORMATHEADER;
  92. // Windows 3.1 BITMAP struct - used to save Win 3.1 .CLP files
  93. typedef struct {
  94. WORD bmType;
  95. WORD bmWidth;
  96. WORD bmHeight;
  97. WORD bmWidthBytes;
  98. BYTE bmPlanes;
  99. BYTE bmBitsPixel;
  100. LPVOID bmBits;
  101. } WIN31BITMAP;
  102. // Windows 3.1 METAFILEPICT struct
  103. typedef struct {
  104. WORD mm;
  105. WORD xExt;
  106. WORD yExt;
  107. WORD hMF;
  108. } WIN31METAFILEPICT;
  109. #pragma pack()
  110. /***************************** global data *******************************/
  111. extern HWND hwndMain;
  112. extern TCHAR szAppName[];
  113. extern TCHAR szFileSpecifier[];
  114. /* variables for the new File Open,File SaveAs and Find Text dialogs */
  115. extern TCHAR szSaveFileName [];
  116. extern TCHAR szLastDir [];
  117. extern TCHAR szFilterSpec []; /* default filter spec. for above */
  118. extern int wHlpMsg; /* message used to invoke Help */
  119. extern TCHAR szOpenCaption []; /* File open dialog caption text */
  120. extern TCHAR szSaveCaption []; /* File Save as dialog caption text */
  121. //
  122. // Common function prototypes that are
  123. // not defined in common lib
  124. //
  125. BOOL SyncOpenClipboard(
  126. HWND hwnd);
  127. BOOL SyncCloseClipboard(void);