multipad.h

Go to the documentation of this file.
00001 
00002 /*  $Id: multipad.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************\
00005 *       This is a part of the Microsoft Source Code Samples. 
00006 *       Copyright (C) 1993-1995 Microsoft Corporation.
00007 *       All rights reserved. 
00008 *       This source code is only intended as a supplement to 
00009 *       Microsoft Development Tools and/or WinHelp documentation.
00010 *       See these sources for detailed information regarding the 
00011 *       Microsoft samples programs.
00012 \******************************************************************************/
00013 
00014 //typedef  int            HFILE          ;
00015 
00016 #ifdef WIN32
00017 #define GET_EM_SETSEL_MPS(iStart, iEnd) (UINT)(iStart), (LONG)(iEnd)
00018 #define GET_WM_COMMAND_ID(wp, lp)       LOWORD(wp)
00019 #define GET_WM_COMMAND_CMD(wp, lp)      HIWORD(wp)
00020 #define GET_WM_COMMAND_HWND(wp, lp)     (HWND)(lp)
00021 #define GET_WM_COMMAND_MPS(id, hwnd, cmd) (UINT)MAKELONG(id, cmd), (LONG)(hwnd)
00022 #define GET_EM_SETSEL_MPS(iStart, iEnd) (UINT)(iStart), (LONG)(iEnd)
00023 #define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp)  (lp == (LONG)hwnd)
00024 #else
00025 #define GET_EM_SETSEL_MPS(iStart, iEnd) 0, MAKELONG(iStart, iEnd)
00026 #define GET_WM_COMMAND_ID(wp, lp)       (wp)
00027 #define GET_WM_COMMAND_CMD(wp, lp)      HIWORD(lp)
00028 #define GET_WM_COMMAND_HWND(wp, lp)     (HWND)LOWORD(lp)
00029 #define GET_WM_COMMAND_MPS(id, hwnd, cmd) (UINT)(id), MAKELONG(hwnd, cmd)
00030 #define GET_EM_SETSEL_MPS(iStart, iEnd) 0, MAKELONG(iStart, iEnd)
00031 #define GET_WM_MDIACTIVATE_FACTIVATE(hwnd, wp, lp)  (BOOL)(wp)
00032 #endif
00033 
00034 #define WINDOWMENU  3   /* position of window menu               */
00035 #define SHORTMENU   2   /* position of short version window menu */
00036 #define MAX_BUFFER      512
00037 #define MAXFILENAME     256
00038 
00039 #define DEFFILESEARCH   (LPSTR) "*.TXT"
00040 
00041 #ifdef RC_INVOKED
00042 #define ID(id) id
00043 #else
00044 #define ID(id) MAKEINTRESOURCE(id)
00045 #endif
00046 
00047 #define CLIENTWND           0
00048 
00049 /* edit control identifier */
00050 #define ID_EDIT 0xCAC
00051 
00052 /* resource ID's */
00053 #define IDMULTIPAD  ID(1)
00054 #define IDMULTIPAD2 ID(3)
00055 
00056 //Icon resource Identifier
00057 #define ID_MULTIPAD_ICON 10000
00058 #define IDNOTE           2
00059 
00060 /* Window word values for child windows */
00061 #define GWL_HWNDEDIT    0
00062 #define GWW_CHANGED     4
00063 #define GWL_WORDWRAP    6
00064 #define GWW_UNTITLED    10
00065 #define CBWNDEXTRA      12
00066 
00067 /* menu ID's */
00068 #define IDM_FILENEW     1001
00069 #define IDM_FILEOPEN    1002
00070 #define IDM_FILESAVE    1003
00071 #define IDM_FILESAVEAS  1004
00072 #define IDM_FILEPRINT   1005
00073 #define IDM_FILEEXIT    1006
00074 #define IDM_FILEABOUT   1007
00075 #define IDM_FILESETUP   1008
00076 #define IDM_FILEMENU    1009
00077 #define IDM_HELP_MENU   1010
00078 
00079 #define IDM_EDITUNDO    2001
00080 #define IDM_EDITCUT     2002
00081 #define IDM_EDITCOPY    2003
00082 #define IDM_EDITPASTE   2004
00083 #define IDM_EDITCLEAR   2005
00084 #define IDM_EDITSELECT  2006
00085 #define IDM_EDITTIME    2007
00086 #define IDM_EDITWRAP    2008
00087 #define IDM_EDITFONT    2009
00088 #define IDM_EDITFIRST   IDM_EDITUNDO
00089 #define IDM_EDITLAST    IDM_EDITFONT
00090 
00091 #define IDM_SEARCHFIND  3001
00092 #define IDM_SEARCHNEXT  3002
00093 #define IDM_SEARCHPREV  3003
00094 #define IDM_SEARCHFIRST IDM_SEARCHFIND
00095 #define IDM_SEARCHLAST  IDM_SEARCHPREV
00096 
00097 #define IDM_WINDOWTILE  4001
00098 #define IDM_WINDOWCASCADE 4002
00099 #define IDM_WINDOWCLOSEALL  4003
00100 #define IDM_WINDOWICONS 4004
00101 
00102 #define IDM_WINDOWCHILD 4100
00103 
00104 #define IDM_HELPHELP    5001
00105 #define IDM_HELPABOUT   5002
00106 #define IDM_HELPSPOT    5003
00107 
00108 #define IDD_FILEOPEN    ID(200)
00109 #define IDD_FILENAME    201
00110 #define IDD_FILES       202
00111 #define IDD_PATH        203
00112 #define IDD_DIRS        204
00113 
00114 /* dialog ids */
00115 #define IDD_ABOUT       ID(300)
00116 
00117 #define IDD_FIND        ID(400)
00118 #define IDD_SEARCH      401
00119 #define IDD_PREV        402
00120 #define IDD_NEXT        IDOK
00121 #define IDD_CASE        403
00122 
00123 #define IDD_SAVEAS      ID(500)
00124 #define IDD_SAVEFROM    501
00125 #define IDD_SAVETO      502
00126 
00127 #define IDD_PRINT       ID(600)
00128 #define IDD_PRINTDEVICE 601
00129 #define IDD_PRINTPORT   602
00130 #define IDD_PRINTTITLE  603
00131 
00132 #define IDD_FONT        ID(700)
00133 #define IDD_FACES       701
00134 #define IDD_SIZES       702
00135 #define IDD_BOLD        703
00136 #define IDD_ITALIC      704
00137 #define IDD_FONTTITLE   705
00138 
00139 /* strings */
00140 #define IDS_CANTOPEN    1
00141 #define IDS_CANTREAD    2
00142 #define IDS_CANTCREATE  3
00143 #define IDS_CANTWRITE   4
00144 #define IDS_ILLFNM      5
00145 #define IDS_ADDEXT      6
00146 #define IDS_CLOSESAVE   7
00147 #define IDS_CANTFIND    8
00148 #define IDS_HELPNOTAVAIL 9
00149 #define IDS_HELPMENUTEXT 10
00150 
00151 #define IDS_CLIENTTITLE 16
00152 #define IDS_UNTITLED    17
00153 #define IDS_APPNAME     18
00154 
00155 #define IDS_PRINTJOB    24
00156 #define IDS_PRINTERROR  25
00157 
00158 /* attribute flags for DlgDirList */
00159 #define ATTR_DIRS       0xC010          /* find drives and directories */
00160 #define ATTR_FILES      0x0000          /* find ordinary files         */
00161 #define PROP_FILENAME   szPropertyName  /* name of property for dialog */
00162 
00163 /*
00164  *  External variable declarations
00165  */
00166 
00167 extern HINSTANCE hInst;            /* application instance handle            */
00168 extern HANDLE hAccel;           /* resource handle of accelerators        */
00169 extern HWND hwndFrame;          /* main window handle                     */
00170 extern HWND hwndMDIClient;      /* handle of MDI Client window            */
00171 extern HWND hwndActive;         /* handle of current active MDI child     */
00172 extern HWND hwndActiveEdit;     /* handle of edit control in active child */
00173 extern LONG styleDefault;       /* default child creation state           */
00174 extern CHAR szChild[];          /* class of child                         */
00175 extern CHAR szSearch[];         /* search string                          */
00176 extern CHAR *szDriver;          /* name of printer driver                 */
00177 extern CHAR szPropertyName[];   /* filename property for dialog box       */
00178 extern INT iPrinter;            /* level of printing capability           */
00179 extern BOOL fCase;              /* searches case sensitive                */
00180 extern WORD cFonts;             /* number of fonts enumerated             */
00181 
00182 /*  externally declared functions
00183  */
00184 BOOL            InitializeApplication(VOID);
00185 BOOL            InitializeInstance(LPSTR, INT);
00186 BOOL CALLBACK   AboutDlgProc(HWND, UINT, WPARAM, LPARAM);
00187 HWND            AddFile(LPSTR lpPath, LPSTR lpName);
00188 VOID            MyReadFile(HWND);
00189 VOID            SaveFile(HWND);
00190 BOOL            ChangeFile(HWND);
00191 VOID            CommandHandler(HWND, WPARAM, LPARAM);
00192 INT             LoadFile(HWND, CHAR *);
00193 VOID            PrintFile(HWND);
00194 BOOL                    GetFileName(LPSTR lpPath, LPSTR lpName);
00195 BOOL            GetInitializationData(HWND);
00196 BOOL CALLBACK   FileOpenDlgProc(HWND, UINT, WPARAM, LPARAM);
00197 VOID            Find(VOID);
00198 VOID            FindNext(VOID);
00199 VOID            FindPrev(VOID);
00200 LONG CALLBACK   MPFrameWndProc(HWND, UINT, WPARAM, LPARAM);
00201 LONG CALLBACK   MPMDIChildWndProc(HWND, UINT, WPARAM, LPARAM);
00202 HDC             GetPrinterDC(BOOL);
00203 VOID            FindPrev(VOID);
00204 VOID            FindNext(VOID);
00205 BOOL CALLBACK   FindDlgProc(HWND, UINT, WPARAM, LPARAM);
00206 SHORT           MPError(HWND,WORD,WORD, char *);
00207 BOOL            IsWild (PSTR);
00208 VOID            SelectFile (HWND);
00209 VOID            Local_FindText ( INT );
00210 VOID            SetSaveFrom (HWND, PSTR);
00211 BOOL            RealSlowCompare (PSTR, PSTR);

Generated on Wed May 31 18:19:56 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6