home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / sdktools / winnt / uconvert / uconvert.h < prev    next >
C/C++ Source or Header  |  1995-10-09  |  7KB  |  183 lines

  1. /**************************************************************************\
  2. * uconvert.h -- header file for uconvert program.
  3. *
  4. * Function prototypes, global variables, & preprocessor defines.
  5. \**************************************************************************/
  6.  
  7. /**************************************************************************\
  8. *  Function prototypes, window procedures first.
  9. \**************************************************************************/
  10.  
  11. LRESULT CALLBACK MainWndProc            (HWND, UINT, WPARAM, LPARAM);
  12. LRESULT CALLBACK AboutProc              (HWND, UINT, WPARAM, LPARAM);
  13. LRESULT CALLBACK SourceOptionsProc      (HWND, UINT, WPARAM, LPARAM);
  14. LRESULT CALLBACK DestinationOptionsProc (HWND, UINT, WPARAM, LPARAM);
  15. LRESULT CALLBACK ConversionOptionsProc  (HWND, UINT, WPARAM, LPARAM);
  16. LRESULT CALLBACK ViewSourceProc         (HWND, UINT, WPARAM, LPARAM);
  17. LRESULT CALLBACK ViewDestinationProc    (HWND, UINT, WPARAM, LPARAM);
  18.  
  19. BOOL IsUnicode (PBYTE );
  20. BOOL IsBOM (PBYTE );
  21. BOOL IsRBOM (PBYTE );
  22.  
  23. VOID framechildwindow     (HDC, HWND, HWND);
  24. VOID underlinechildwindow (HDC, HWND, HWND);
  25.  
  26. VOID createwindows(PRECT, HWND, HWND*, HWND*, HWND*, HWND*, HWND*, HWND*);
  27.  
  28. LPVOID ManageMemory (UINT, UINT, DWORD, LPVOID);
  29.  
  30. LPTSTR LoadResourceString(UINT);
  31.  
  32.  
  33. /**************************************************************************\
  34. *  Global variables (declared in uconvert.c).
  35. \**************************************************************************/
  36.  
  37. /* Child windows appearing on the main frame window. */
  38. extern HWND hwndLabel0,     hwndLabel1;
  39. extern HWND hwndName0,      hwndName1;
  40. extern HWND hwndSize0,      hwndSize1;
  41. extern HWND hwndCodePage0,  hwndCodePage1;
  42. extern HWND hwndByteOrder0, hwndByteOrder1;
  43. extern HWND hwndButton0,    hwndButton1;
  44.  
  45. /* Information specifying which is unicode and what the other code page is. */
  46. extern int  gTypeSource;
  47. extern UINT giSourceCodePage;
  48. extern UINT giDestinationCodePage;
  49.  
  50. /* pointers to global source & destination data, and byte count. */
  51. extern PBYTE pSourceData;
  52. extern PBYTE pDestinationData;
  53. extern int   nBytesSource;
  54. extern int   nBytesDestination;
  55.  
  56. /* Conversion Options variables. */
  57. extern DWORD gMBFlags;
  58. extern DWORD gWCFlags;
  59. extern char  glpDefaultChar[];
  60. extern BOOL  gUsedDefaultChar;
  61.  
  62.  
  63.  
  64. /**************************************************************************\
  65. *  Defined constants.
  66. \**************************************************************************/
  67.  
  68. /* Messages that can be send to ManageMemory() as first param */
  69. #define MMALLOC 1
  70. #define MMFREE  2
  71. /* Messages that can be send to ManageMemory() as second param */
  72. #define MMSOURCE       3
  73. #define MMDESTINATION  4
  74.  
  75. /* Allowed values for the global variable gTypeSource */
  76. #define TYPEUNKNOWN     0
  77. #define TYPEUNICODE     1
  78. #define TYPECODEPAGE    2
  79.  
  80. /* "user message."  Used by main window.  */
  81. #define  WMU_SETTYPESTRINGS     WM_USER +1
  82. #define  WMU_ADJUSTFORNEWSOURCE WM_USER +2
  83.  
  84. /* menu IDs */
  85. #define  MID_OPEN                    1001
  86. #define  MID_SAVEAS                  1002
  87. #define  MID_EXIT                    1010
  88.  
  89. #define  MID_COPYDESTINATION         2001
  90. #define  MID_PASTESOURCE             2002
  91. #define  MID_CLEARSOURCE             2003
  92. #define  MID_CLEARDESTINATION        2004
  93.  
  94. #define  MID_CONVERTNOW              3001
  95. #define  MID_SOURCEOPT               3002
  96. #define  MID_DESTINATIONOPT          3003
  97. #define  MID_CONVERSIONOPT           3004
  98. #define  MID_SWAPSOURCE              3005
  99. #define  MID_SWAPDESTINATION         3006
  100. #define  MID_INSTALLTABLES           3007
  101.  
  102. #define  MID_HELP                    4001
  103. #define  MID_ABOUT                   4002
  104.  
  105. /* button IDs (should be disjoint from menu IDs) */
  106. #define  BID_VIEWSOURCE                59
  107. #define  BID_VIEWDESTINATION           60
  108.  
  109. /* dialog IDs */
  110. #define  DID_NAME                     100
  111. #define  DID_TYPE                     101
  112. #define  DID_FONT                     102
  113. #define  DID_TEXT                     103
  114.  
  115. #define  DID_CODEPAGELIST             300
  116. #define  DID_RBUNICODE                301
  117. #define  DID_RBANSICP                 302
  118. #define  DID_RBOEMCP                  303
  119. #define  DID_RBOTHERCP                304
  120. #define  DID_CBBYTEORDER              305
  121.  
  122. #define  DID_PRECOMPOSED              401
  123. #define  DID_COMPOSITE                402
  124. #define  DID_USEGLYPHCHARS            403
  125.  
  126. #define  DID_COMPOSITECHECK           451
  127. #define  DID_DISCARDNS                452
  128. #define  DID_SEPCHARS                 453
  129. #define  DID_DEFAULTCHAR              454
  130. #define  DID_EFDEFAULTCHAR            455
  131. #define  DID_USEDDEFAULTCHAR          456
  132.  
  133. /* Define a value for the LOGFONT.lfCharSet
  134.  *  This should be included in wingdi.h, but it
  135.  *  was removed because the font mapper is not
  136.  *  using it anyway in version 1.0.  Currently
  137.  *  scheduled to be included in NT ver 1.1.
  138.  */
  139. #define UNICODE_CHARSET  1
  140.  
  141.  
  142. /* string id */
  143. #define  IDS_SOURCE                   501
  144. #define  IDS_DESTINATION              502
  145. #define  IDS_VIEW_SOURCE_BTN          503
  146. #define  IDS_VIEW_DESTINATION_BTN     504
  147. #define  IDS_FILE_FILTER_SPEC1        505
  148. #define  IDS_FILE_FILTER_SPEC2        506
  149. #define  IDS_FILE_FILTER_SPEC3        507
  150. #define  IDS_CODE_PAGE                508
  151. #define  IDS_OPEN_FILE_TITLE          509
  152. #define  IDS_OPEN_FILE_FAILED         510
  153. #define  IDS_FILE_TOO_BIG             511
  154. #define  IDS_READFILE_FAILED          512
  155. #define  IDS_SWAPPING_BYTE_ORDER      513
  156. #define  IDS_NOTEXT_TO_SAVE           514
  157. #define  IDS_SAVE_AS_TITLE            515
  158. #define  IDS_CREATEFILE_FAILED        516
  159. #define  IDS_WRITEFILE_FAILED         517
  160. #define  IDS_FROM_CLIPBOARD           518
  161. #define  IDS_LOAD_SOURCE_FILE         519
  162. #define  IDS_SOURCE_TYPE_UNKNOWN      520
  163. #define  IDS_DATA_NOT_SAVED           521
  164. #define  IDS_BYTES                    522
  165. #define  IDS_BYTE_ORDER_REVERSED      533
  166. #define  IDS_APP_WARNING              534
  167. #define  IDS_INTERPRET_SOURCE_AS      535
  168. #define  IDS_CONVERT_DEST_TO          536
  169. #define  IDS_VIEW_SOURCE_TITLE        537
  170. #define  IDS_VIEW_DEST_TITLE          538
  171. #define  IDS_FILE_FILTER_SPEC4        539
  172. #define  IDS_TABLE_FILE_TITLE         540
  173. #define  IDS_INCORRECT_FILE_TYPE      541
  174. #define  IDS_FILENAME_OVERFLOW        542
  175. #define  IDS_LOGON_AS_ADMIN           543
  176. #define  IDS_ACCESS_DENIED            544
  177. #define  IDS_REGOPENKEYEX_FAILED      545
  178. #define  IDS_FILE_ALREADY_EXISTS      546
  179. #define  IDS_FILE_CP_FAILED_AGAIN     547
  180. #define  IDS_FILE_CP_FAILED           548
  181. #define  IDS_FILE_PARSE_FAILED        549
  182. #define  IDS_FIRSTCALL_FAILED         550
  183.