-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
84 lines (72 loc) · 2.32 KB
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* Notepad (notepad.h)
*
* Copyright 1997,98 Marcel Baur <[email protected]>
* Copyright 2002 Sylvain Petreolle <[email protected]>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define SIZEOF(a) sizeof(a)/sizeof((a)[0])
#include "notepad_res.h"
#include <dos.h>
#define MAX_PATH FILENAME_MAX
#define MAX_STRING_LEN 255
#include <commdlg.h>
#include <shellapi.h>
typedef struct
{
HANDLE hInstance;
HWND hMainWnd;
HWND hFindReplaceDlg;
HWND hEdit;
HFONT hFont; /* Font used by the edit control */
LOGFONT lfFont;
BOOL bWrapLongLines;
char szFindText[MAX_PATH];
char szFileName[MAX_PATH];
char szFileTitle[MAX_PATH];
char szFilter[2 * MAX_STRING_LEN + 100];
int iMarginTop;
int iMarginBottom;
int iMarginLeft;
int iMarginRight;
char szHeader[MAX_PATH];
char szFooter[MAX_PATH];
FINDREPLACE find;
FINDREPLACE lastFind;
HGLOBAL hDevMode; /* printer mode */
HGLOBAL hDevNames; /* printer names */
// Time settings
char s1159[10];
char s2359[10];
char sTime[5];
int iTime;
int iTLZero;
// Date settings
char sShortDate[20];
char sDate[3];
} NOTEPAD_GLOBALS;
extern NOTEPAD_GLOBALS Globals;
VOID SetFileName(LPCSTR szFileName);
void NOTEPAD_DoFind(FINDREPLACE FAR *fr);
DWORD get_dpi(void);
#define GlobalPtrHandle(lp) \
((HGLOBAL)LOWORD(GlobalHandle(SELECTOROF(lp))))
#define GlobalUnlockPtr(lp) \
GlobalUnlock(GlobalPtrHandle(lp))
#define GlobalFreePtr(lp) \
(GlobalUnlockPtr(lp),(BOOL)GlobalFree(GlobalPtrHandle(lp)))
#define GlobalAllocPtr(flags, cb) \
(GlobalLock(GlobalAlloc((flags), (cb))))