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