Source code of Windows XP (NT5)
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.

215 lines
6.4 KiB

  1. #include "windows.h"
  2. #ifndef WIN16
  3. #ifndef WIN32
  4. #define WIN32 1 // placed because RC can't pass in C_DEFINES
  5. #endif
  6. #include <commdlg.h>
  7. #endif
  8. #define CCHKEYMAX 32 // max characters in search string
  9. #define GET_EM_SETSEL_MPS(iStart, iEnd) (UINT)(iStart), (LONG)(iEnd)
  10. #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
  11. #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
  12. #define GET_WM_COMMAND_MPS(id, hwnd, cmd) (UINT)MAKELONG(id, cmd), (LONG)(hwnd)
  13. #define GET_EM_SETSEL_MPS(iStart, iEnd) (UINT)(iStart), (LONG)(iEnd)
  14. #define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp) (lp == (LONG_PTR)hwnd)
  15. #define WINDOWMENU 2 // position of window menu
  16. #define SHORTMENU 2 // position of short version window menu
  17. #define DEFFILESEARCH (LPSTR) "*.LOG"
  18. #ifdef RC_INVOKED
  19. #define ID(id) id
  20. #else
  21. #define ID(id) MAKEINTRESOURCE(id)
  22. #endif
  23. // edit control identifier
  24. #define ID_EDIT 0xCAC
  25. // resource ID's
  26. #define IDLOGVIEW ID(1)
  27. #define IDLOGVIEW2 ID(3)
  28. #define IDNOTE ID(2)
  29. // Window word values for child windows
  30. #define GWL_HWNDEDIT 0
  31. #define GWW_CHANGED 4
  32. #define GWL_WORDWRAP 6
  33. #define GWW_UNTITLED 10
  34. #define CBWNDEXTRA 12
  35. // menu ID's
  36. #define IDM_FILENEW 1001
  37. #define IDM_FILEOPEN 1002
  38. #define ID_HELP_INDEX 1003
  39. #define ID_HELP_USING 1004
  40. #define ID_HELP_CONT 1005
  41. #define IDM_FILEPRINT 1006
  42. #define IDM_FILEEXIT 1007
  43. #define IDM_FILEABOUT 1008
  44. #define IDM_FILESETUP 1009
  45. #define IDM_FILEMENU 1010
  46. #define IDM_EDITUNDO 2001
  47. #define IDM_EDITCUT 2002
  48. #define IDM_EDITCOPY 2003
  49. #define IDM_EDITPASTE 2004
  50. #define IDM_EDITCLEAR 2005
  51. #define IDM_EDITSELECT 2006
  52. #define IDM_EDITTIME 2007
  53. #define IDM_EDITWRAP 2008
  54. #define IDM_EDITFONT 2009
  55. #define IDM_EDITFIRST IDM_EDITUNDO
  56. #define IDM_EDITLAST IDM_EDITFONT
  57. #define IDM_SEARCHFIND 3001
  58. #define IDM_SEARCHNEXT 3002
  59. #define IDM_SEARCHPREV 3003
  60. #define IDM_SEARCHFIRST IDM_SEARCHFIND
  61. #define IDM_SEARCHLAST IDM_SEARCHPREV
  62. #define IDM_WINDOWTILE 4001
  63. #define IDM_WINDOWCASCADE 4002
  64. #define IDM_WINDOWCLOSEALL 4003
  65. #define IDM_WINDOWICONS 4004
  66. #define IDM_WINDOWCHILD 4100
  67. #define IDM_HELPHELP 5001
  68. #define IDM_HELPABOUT 5002
  69. #define IDM_HELPSPOT 5003
  70. #define IDD_FILEOPEN ID(200)
  71. #define IDD_FILENAME 201
  72. #define IDD_FILES 202
  73. #define IDD_PATH 203
  74. #define IDD_DIRS 204
  75. // dialog ids
  76. #define IDD_ABOUT ID(300)
  77. #define IDD_FIND ID(400)
  78. #define IDD_SEARCH 401
  79. #define IDD_PREV 402
  80. #define IDD_NEXT IDOK
  81. #define IDD_CASE 403
  82. #define IDD_SAVEAS ID(500)
  83. #define IDD_SAVEFROM 501
  84. #define IDD_SAVETO 502
  85. #define IDD_PRINT ID(600)
  86. #define IDD_PRINTDEVICE 601
  87. #define IDD_PRINTPORT 602
  88. #define IDD_PRINTTITLE 603
  89. #define IDD_FONT ID(700)
  90. #define IDD_FACES 701
  91. #define IDD_SIZES 702
  92. #define IDD_BOLD 703
  93. #define IDD_ITALIC 704
  94. #define IDD_FONTTITLE 705
  95. // +------------------------------------------------------------------------+
  96. // About Box
  97. // +------------------------------------------------------------------------+
  98. #define IDC_AVAIL_MEM 101
  99. #define IDC_PHYSICAL_MEM 101
  100. #define IDC_LICENSEE_COMPANY 104
  101. #define IDC_LICENSEE_NAME 105
  102. #define IDD_SPLASH 105
  103. #define IDC_MATH_COPR 106
  104. #define IDC_DISK_SPACE 107
  105. #define IDC_BIGICON 1001
  106. // strings
  107. #define IDS_CANTOPEN 1
  108. #define IDS_CANTREAD 2
  109. #define IDS_CANTCREATE 3
  110. #define IDS_CANTWRITE 4
  111. #define IDS_ILLFNM 5
  112. #define IDS_ADDEXT 6
  113. #define IDS_CLOSESAVE 7
  114. #define IDS_CANTFIND 8
  115. #define IDS_HELPNOTAVAIL 9
  116. #define IDS_CANTFINDSTR 10
  117. #define IDS_CLIENTTITLE 16
  118. #define IDS_UNTITLED 17
  119. #define IDS_APPNAME 18
  120. #define IDS_PRINTJOB 24
  121. #define IDS_PRINTERROR 25
  122. #define IDS_DISK_SPACE_UNAVAIL 26
  123. #define IDS_DISK_SPACE 27
  124. #define IDS_MATH_COPR_NOTPRESENT 28
  125. #define IDS_MATH_COPR_PRESENT 29
  126. #define IDS_AVAIL_MEM 30
  127. #define IDS_PHYSICAL_MEM 31
  128. #define IDS_OPENTEXT 32
  129. #define IDS_OPENFILTER 33
  130. #define IDS_DEFEXT 34
  131. #define IDC_STATIC -1
  132. // attribute flags for DlgDirList
  133. #define ATTR_DIRS 0xC010 // find drives and directories
  134. #define ATTR_FILES 0x0000 // find ordinary files
  135. #define PROP_FILENAME szPropertyName // name of property for dialog
  136. // External variable declarations
  137. extern HANDLE hInst; // application instance handle
  138. extern HANDLE hAccel; // resource handle of accelerators
  139. extern HWND hwndFrame; // main window handle
  140. extern HWND hwndMDIClient; // handle of MDI Client window
  141. extern HWND hwndActive; // handle of current active MDI child
  142. extern HWND hwndActiveEdit; // handle of edit control in active child
  143. extern LONG styleDefault; // default child creation state
  144. extern CHAR szChild[]; // class of child
  145. extern CHAR szSearch[]; // search string
  146. extern CHAR *szDriver; // name of printer driver
  147. extern CHAR szPropertyName[]; // filename property for dialog box
  148. extern INT iPrinter; // level of printing capability
  149. extern BOOL fCase; // searches case sensitive
  150. extern WORD cFonts; // number of fonts enumerated
  151. extern FINDREPLACE FR;
  152. extern UINT wHlpMsg;
  153. extern UINT wFRMsg;
  154. extern BOOL fReverse;
  155. extern HANDLE hStdCursor, hWaitCursor;
  156. // externally declared functions
  157. extern BOOL APIENTRY InitializeApplication(VOID);
  158. extern BOOL APIENTRY InitializeInstance(LPSTR,INT);
  159. extern BOOL APIENTRY AboutDlgProc(HWND,UINT,UINT,LONG);
  160. extern HWND APIENTRY AddFile(CHAR *);
  161. extern VOID APIENTRY MyReadFile(HWND);
  162. extern INT APIENTRY LoadFile(HWND, CHAR *);
  163. extern VOID APIENTRY PrintFile(HWND);
  164. extern BOOL APIENTRY GetInitializationData(HWND);
  165. extern SHORT MPError(HWND,WORD,WORD, char *);
  166. extern VOID APIENTRY Find(VOID);
  167. extern VOID APIENTRY FindNext(VOID);
  168. extern VOID APIENTRY FindPrev(VOID);
  169. extern LRESULT APIENTRY MPFrameWndProc(HWND,UINT,UINT,LONG);
  170. extern LRESULT APIENTRY MPMDIChildWndProc(HWND,UINT,UINT,LONG);
  171. extern HDC APIENTRY GetPrinterDC(BOOL);
  172. extern VOID NEAR PASCAL SetSaveFrom (HWND, PSTR);
  173. extern BOOL NEAR PASCAL RealSlowCompare (PSTR, PSTR);
  174. extern VOID APIENTRY FindPrev (VOID);
  175. extern VOID APIENTRY FindNext (VOID);
  176. extern BOOL NEAR PASCAL IsWild (PSTR);
  177. extern VOID NEAR PASCAL SelectFile (HWND);
  178. extern VOID NEAR PASCAL Local_FindText ( INT );