home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / vrac / mpad32.zip / MULTIPAD.H < prev    next >
C/C++ Source or Header  |  1994-04-15  |  7KB  |  204 lines

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