home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / mdi / regmpad / multipad.h < prev    next >
C/C++ Source or Header  |  1995-11-22  |  8KB  |  228 lines

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