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.

165 lines
3.9 KiB

  1. /*************************************************
  2. * lctool.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. #define MAX_CHAR_NUM 1000
  8. #define MAX_PHRASE_LEN 128
  9. #define SEGMENT_SIZE 60
  10. #define NULL_SEG 0xffff
  11. #define MAX_LINE 19
  12. #define CTRL_STATE 0x8000
  13. #include <TCHAR.H>
  14. #ifdef UNICODE
  15. typedef DWORD UNALIGNED FAR *LPUNADWORD;
  16. typedef WORD UNALIGNED FAR *LPUNAWORD;
  17. typedef TCHAR UNALIGNED FAR *LPUNATCHAR;
  18. #else
  19. typedef DWORD FAR *LPUNADWORD;
  20. typedef WORD FAR *LPUNAWORD;
  21. typedef TCHAR FAR *LPUNATCHAR;
  22. #define TCHAR UCHAR
  23. #endif
  24. #define STRSAFE_NO_DEPRECATE
  25. #include "strsafe.h"
  26. #define FILE_BIG5 0
  27. #define FILE_UNICODE 1
  28. #ifndef ARRAYSIZE
  29. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  30. #endif
  31. // Global function prototypes.
  32. // LCTOOL.C
  33. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
  34. LRESULT CALLBACK WndSubProc(HWND, UINT, WPARAM, LPARAM);
  35. BOOL lcAllocWord();
  36. BOOL lcAllocPhrase();
  37. UINT lcGetSeg();
  38. void lcFreeSeg(UINT);
  39. // LCFILE.C
  40. BOOL lcAppend(HWND);
  41. BOOL lcFOpen(HWND);
  42. #ifdef UNICODE
  43. BOOL lcFSave(HWND, BOOL);
  44. #else
  45. BOOL lcFSave(HWND);
  46. #endif
  47. BOOL lcImport(HWND);
  48. #ifdef UNICODE
  49. BOOL lcExport(HWND,int);
  50. #else
  51. BOOL lcExport(HWND);
  52. #endif
  53. void lcQueryModify(HWND);
  54. BOOL lcQuerySave(HWND);
  55. void lcErrIOMsg(UINT, UCHAR *);
  56. // LCFUNC.C
  57. BOOL lcKey(HWND, WPARAM, USHORT);
  58. BOOL lcTab_key(HWND);
  59. void lcUp_key(HWND);
  60. void lcDown_key(HWND);
  61. void lcPgUp_key(HWND);
  62. void lcPgDown_key(HWND);
  63. void lcGoto(HWND);
  64. void lcErrMsg(UINT);
  65. BOOL lcSaveEditText(UINT, UINT);
  66. BOOL lcSetEditText(UINT, BOOL);
  67. void lcDelLine(HWND);
  68. void lcInsLine(HWND);
  69. BOOL lcSort(HWND);
  70. UINT lcGetEditFocus(HWND, BOOL *);
  71. BOOL is_DBCS(WORD, BOOL);
  72. BOOL is_DBCS2(WORD, BOOL);
  73. void lcEditFocusOn(WORD);
  74. BOOL lcDisp2Mem(UINT, TCHAR *);
  75. UINT lcMem2Disp(UINT, TCHAR *);
  76. void lcChangeSequence(HWND hwnd);
  77. void lcSearch(HWND hwnd, BOOL);
  78. // LCPRINT.C
  79. BOOL WINAPI GetPrinterConfig(HWND);
  80. int WINAPI lcPrint(HWND);
  81. BOOL is_DBCS_1st(TCHAR *, int);
  82. //-------------------------------------------------------------------------
  83. // Global variable declarations.
  84. HINSTANCE hInst; // The current instance handle
  85. HANDLE hwndMain;
  86. HANDLE hMenu;
  87. HCURSOR hCursorWait;
  88. HCURSOR hCursorArrow;
  89. HWND hwndWord[MAX_LINE];
  90. HWND hwndPhrase[MAX_LINE];
  91. HWND hwndFocus;
  92. WORD wOldID;
  93. UINT iPage_line; // Line number per page
  94. UINT iDisp_Top;
  95. BOOL bSaveFile;
  96. WORD wSameCode;
  97. int xPos, yPos;
  98. TCHAR szFilterSpec[MAX_PATH];
  99. TCHAR szExt[10];
  100. //-------------------------------------------------------------------------
  101. // Memory blobal variable declarations.
  102. //
  103. // Warning : iFirst_Seg & iNext_Seg store only SEGMENT number but address
  104. // for address can not mainten after GlobalRealloc
  105. //
  106. #ifdef UNICODE
  107. typedef struct{
  108. DWORD lFirst_Seg;
  109. TCHAR wWord;
  110. } WORDBUF, FAR *LPWORDBUF;
  111. typedef struct STRUCT_PHRASE{
  112. DWORD lNext_Seg;
  113. TCHAR szPhrase[SEGMENT_SIZE];
  114. } PHRASEBUF, FAR *LPPHRASEBUF;
  115. #else
  116. typedef struct{
  117. UINT iFirst_Seg;
  118. WORD wWord;
  119. } WORDBUF, FAR *LPWORDBUF;
  120. typedef struct STRUCT_PHRASE{
  121. UINT iNext_Seg;
  122. UCHAR szPhrase[SEGMENT_SIZE];
  123. } PHRASEBUF, FAR *LPPHRASEBUF;
  124. #endif
  125. HANDLE hWord;
  126. #ifdef UNICODE
  127. DWORD nWordBuffsize;
  128. DWORD lWordBuff;
  129. #else
  130. UINT nWordBuffsize;
  131. UINT iWordBuff;
  132. #endif
  133. LPWORDBUF lpWord;
  134. HANDLE hPhrase;
  135. #ifdef UNICODE
  136. DWORD nPhraseBuffsize;
  137. DWORD lPhraseBuff;
  138. #else
  139. UINT nPhraseBuffsize;
  140. UINT iPhraseBuff;
  141. #endif
  142. LPPHRASEBUF lpPhrase;
  143. UINT iFirstFree;
  144. //