ReactOS 0.4.15-dev-8116-gf69e256
main.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Notepad
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Providing a Windows-compatible simple text editor for ReactOS
5 * COPYRIGHT: Copyright 2000 Mike McCormack <Mike_McCormack@looksmart.com.au>
6 * Copyright 1997,98 Marcel Baur <mbaur@g26.ethz.ch>
7 * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
8 * Copyright 2002 Andriy Palamarchuk
9 * Copyright 2020-2023 Katayama Hirofumi MZ
10 */
11
12#include "notepad.h"
13
14#include <shlobj.h>
15#include <strsafe.h>
16
19
21{
22 BOOL bEmpty = (GetWindowTextLengthW(Globals.hEdit) == 0);
23 UINT uEnable = MF_BYCOMMAND | (bEmpty ? MF_GRAYED : MF_ENABLED);
27}
28
29/***********************************************************************
30 * SetFileName
31 *
32 * Sets Global File Name.
33 */
35{
37 Globals.szFileTitle[0] = 0;
39
40 if (szFileName && szFileName[0])
41 SHAddToRecentDocs(SHARD_PATHW, szFileName);
42}
43
44/***********************************************************************
45 * NOTEPAD_MenuCommand
46 *
47 * All handling of main menu events
48 */
50{
51 switch (wParam)
52 {
53 case CMD_NEW: DIALOG_FileNew(); break;
55 case CMD_OPEN: DIALOG_FileOpen(); break;
56 case CMD_SAVE: DIALOG_FileSave(); break;
57 case CMD_SAVE_AS: DIALOG_FileSaveAs(); break;
58 case CMD_PRINT: DIALOG_FilePrint(); break;
60 case CMD_EXIT: DIALOG_FileExit(); break;
61
62 case CMD_UNDO: DIALOG_EditUndo(); break;
63 case CMD_CUT: DIALOG_EditCut(); break;
64 case CMD_COPY: DIALOG_EditCopy(); break;
65 case CMD_PASTE: DIALOG_EditPaste(); break;
66 case CMD_DELETE: DIALOG_EditDelete(); break;
69
70 case CMD_SEARCH: DIALOG_Search(); break;
72 case CMD_REPLACE: DIALOG_Replace(); break;
73 case CMD_GOTO: DIALOG_GoTo(); break;
75
76 case CMD_WRAP: DIALOG_EditWrap(); break;
77 case CMD_FONT: DIALOG_SelectFont(); break;
78
80
83
84 default:
85 break;
86 }
87 return 0;
88}
89
90/***********************************************************************
91 * NOTEPAD_FindTextAt
92 */
93static BOOL
94NOTEPAD_FindTextAt(FINDREPLACE *pFindReplace, LPCTSTR pszText, INT iTextLength, DWORD dwPosition)
95{
96 BOOL bMatches;
97 size_t iTargetLength;
98 LPCTSTR pchPosition;
99
100 if (!pFindReplace || !pszText)
101 return FALSE;
102
103 iTargetLength = _tcslen(pFindReplace->lpstrFindWhat);
104 pchPosition = &pszText[dwPosition];
105
106 /* Make proper comparison */
107 if (pFindReplace->Flags & FR_MATCHCASE)
108 bMatches = !_tcsncmp(pchPosition, pFindReplace->lpstrFindWhat, iTargetLength);
109 else
110 bMatches = !_tcsnicmp(pchPosition, pFindReplace->lpstrFindWhat, iTargetLength);
111
112 if (bMatches && (pFindReplace->Flags & FR_WHOLEWORD))
113 {
114 if (dwPosition > 0)
115 {
116 if (_istalnum(*(pchPosition - 1)) || *(pchPosition - 1) == _T('_'))
117 bMatches = FALSE;
118 }
119 if ((INT)dwPosition + iTargetLength < iTextLength)
120 {
121 if (_istalnum(pchPosition[iTargetLength]) || pchPosition[iTargetLength] == _T('_'))
122 bMatches = FALSE;
123 }
124 }
125
126 return bMatches;
127}
128
129/***********************************************************************
130 * NOTEPAD_FindNext
131 */
132BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert)
133{
134 int iTextLength, iTargetLength;
135 size_t iAdjustment = 0;
136 LPTSTR pszText = NULL;
137 DWORD dwPosition, dwBegin, dwEnd;
138 BOOL bMatches = FALSE;
139 TCHAR szResource[128], szText[128];
141
142 iTargetLength = (int) _tcslen(pFindReplace->lpstrFindWhat);
143
144 /* Retrieve the window text */
145 iTextLength = GetWindowTextLength(Globals.hEdit);
146 if (iTextLength > 0)
147 {
148 pszText = (LPTSTR) HeapAlloc(GetProcessHeap(), 0, (iTextLength + 1) * sizeof(TCHAR));
149 if (!pszText)
150 return FALSE;
151
152 GetWindowText(Globals.hEdit, pszText, iTextLength + 1);
153 }
154
155 SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM) &dwBegin, (LPARAM) &dwEnd);
156 if (bReplace && ((dwEnd - dwBegin) == (DWORD) iTargetLength))
157 {
158 if (NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwBegin))
159 {
161 iAdjustment = _tcslen(pFindReplace->lpstrReplaceWith) - (dwEnd - dwBegin);
162 }
163 }
164
165 if (pFindReplace->Flags & FR_DOWN)
166 {
167 /* Find Down */
168 dwPosition = dwEnd;
169 while(dwPosition < (DWORD) iTextLength)
170 {
171 bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition);
172 if (bMatches)
173 break;
174 dwPosition++;
175 }
176 }
177 else
178 {
179 /* Find Up */
180 dwPosition = dwBegin;
181 while(dwPosition > 0)
182 {
183 dwPosition--;
184 bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition);
185 if (bMatches)
186 break;
187 }
188 }
189
190 if (bMatches)
191 {
192 /* Found target */
193 if (dwPosition > dwBegin)
194 dwPosition += (DWORD) iAdjustment;
195 SendMessage(Globals.hEdit, EM_SETSEL, dwPosition, dwPosition + iTargetLength);
197 bSuccess = TRUE;
198 }
199 else
200 {
201 /* Can't find target */
202 if (bShowAlert)
203 {
204 LoadString(Globals.hInstance, STRING_CANNOTFIND, szResource, _countof(szResource));
205 StringCchPrintf(szText, _countof(szText), szResource, pFindReplace->lpstrFindWhat);
206 LoadString(Globals.hInstance, STRING_NOTEPAD, szResource, _countof(szResource));
207 MessageBox(Globals.hFindReplaceDlg, szText, szResource, MB_OK);
208 }
209 bSuccess = FALSE;
210 }
211
212 if (pszText)
213 HeapFree(GetProcessHeap(), 0, pszText);
214 return bSuccess;
215}
216
217/***********************************************************************
218 * NOTEPAD_ReplaceAll
219 */
221{
222 BOOL bShowAlert = TRUE;
223
225
226 while (NOTEPAD_FindNext(pFindReplace, TRUE, bShowAlert))
227 {
228 bShowAlert = FALSE;
229 }
230}
231
232/***********************************************************************
233 * NOTEPAD_FindTerm
234 */
236{
238}
239
240/***********************************************************************
241 * Data Initialization
242 */
244{
245 LPTSTR p;
246 static const TCHAR txt_files[] = _T("*.txt");
247 static const TCHAR all_files[] = _T("*.*");
248
249 ZeroMemory(&Globals, sizeof(Globals));
252
256 p += _countof(txt_files);
257
260 p += _countof(all_files);
261 *p = '\0';
263
266}
267
268/***********************************************************************
269 * Enable/disable items on the menu based on control state
270 */
272{
273 DWORD dwStart, dwEnd;
274 int enable;
275
277
284 SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM)&dwStart, (LPARAM)&dwEnd);
285 enable = ((dwStart == dwEnd) ? MF_GRAYED : MF_ENABLED);
289
292}
293
295{
296 switch (msg)
297 {
298 case WM_KEYDOWN:
299 case WM_KEYUP:
300 {
301 switch (wParam)
302 {
303 case VK_UP:
304 case VK_DOWN:
305 case VK_LEFT:
306 case VK_RIGHT:
308 break;
309 default:
310 {
312 break;
313 }
314 }
315 }
316 case WM_LBUTTONUP:
317 {
319 break;
320 }
321 }
323}
324
325/***********************************************************************
326 * NOTEPAD_WndProc
327 */
328static LRESULT
329WINAPI
331{
332 switch (msg)
333 {
334
335 case WM_CREATE:
338
339 DragAcceptFiles(hWnd, TRUE); /* Accept Drag & Drop */
340
341 /* Create controls */
344
345 DIALOG_FileNew(); /* Initialize file info */
346
347 // For now, the "Help" dialog is disabled due to the lack of HTML Help support
349 break;
350
351 case WM_COMMAND:
354 if ((HIWORD(wParam) == EN_CHANGE))
357 break;
358
359 case WM_CLOSE:
360 if (DoCloseFile())
362 break;
363
365 if (DoCloseFile()) {
366 return 1;
367 }
368 break;
369
370 case WM_DESTROY:
371 if (Globals.hFont)
373 if (Globals.hDevMode)
375 if (Globals.hDevNames)
380 break;
381
382 case WM_SIZE:
383 {
384 RECT rc;
385 GetClientRect(hWnd, &rc);
386
388 {
389 RECT rcStatus;
391 GetWindowRect(Globals.hStatusBar, &rcStatus);
392 rc.bottom -= rcStatus.bottom - rcStatus.top;
393 }
394
395 MoveWindow(Globals.hEdit, 0, 0, rc.right, rc.bottom, TRUE);
396
398 {
399 /* Align status bar parts, only if the status bar resize operation succeeds */
401 }
402 break;
403 }
404
405 /* The entire client area is covered by edit control and by
406 * the status bar. So there is no need to erase main background.
407 * This resolves the horrible flicker effect during windows resizes. */
408 case WM_ERASEBKGND:
409 return 1;
410
411 case WM_SETFOCUS:
413 break;
414
415 case WM_DROPFILES:
416 {
417 TCHAR szFileName[MAX_PATH];
418 HDROP hDrop = (HDROP) wParam;
419
420 DragQueryFile(hDrop, 0, szFileName, _countof(szFileName));
421 DragFinish(hDrop);
422 DoOpenFile(szFileName);
423 break;
424 }
425
426 case WM_INITMENUPOPUP:
428 break;
429
430 default:
431 if (msg == aFINDMSGSTRING)
432 {
433 FINDREPLACE *pFindReplace = (FINDREPLACE *) lParam;
435
437
438 if (pFindReplace->Flags & FR_FINDNEXT)
439 NOTEPAD_FindNext(pFindReplace, FALSE, TRUE);
440 else if (pFindReplace->Flags & FR_REPLACE)
441 NOTEPAD_FindNext(pFindReplace, TRUE, TRUE);
442 else if (pFindReplace->Flags & FR_REPLACEALL)
443 NOTEPAD_ReplaceAll(pFindReplace);
444 else if (pFindReplace->Flags & FR_DIALOGTERM)
446
448 break;
449 }
450
452 }
453 return 0;
454}
455
456static int AlertFileDoesNotExist(LPCTSTR szFileName)
457{
459 szFileName,
461}
462
464{
465 BOOL opt_print = FALSE;
467
468 while (*cmdline == _T(' ') || *cmdline == _T('-') || *cmdline == _T('/'))
469 {
471
472 if (*cmdline++ == _T(' ')) continue;
473
474 option = *cmdline;
475 if (option) cmdline++;
476 while (*cmdline == _T(' ')) cmdline++;
477
478 switch(option)
479 {
480 case 'p':
481 case 'P':
482 opt_print = TRUE;
483 break;
484 }
485 }
486
487 if (*cmdline)
488 {
489 /* file name is passed in the command line */
493
494 if (cmdline[0] == _T('"'))
495 {
496 cmdline++;
497 cmdline[lstrlen(cmdline) - 1] = 0;
498 }
499
502 {
504 }
505 else if (!HasFileExtension(cmdline))
506 {
507 static const TCHAR txt[] = _T(".txt");
508
509 /* try to find file with ".txt" extension */
510 if (!_tcscmp(txt, cmdline + _tcslen(cmdline) - _tcslen(txt)))
511 {
513 }
514 else
515 {
516 _tcsncpy(buf, cmdline, MAX_PATH - _tcslen(txt) - 1);
517 _tcscat(buf, txt);
518 file_name = buf;
520 }
521 }
522
524
525 if (file_exists)
526 {
529 if (opt_print)
530 {
532 return FALSE;
533 }
534 }
535 else
536 {
538 {
539 case IDYES:
541 break;
542
543 case IDNO:
544 break;
545 }
546 }
547 }
548
549 return TRUE;
550}
551
552/***********************************************************************
553 * WinMain
554 */
556{
557 MSG msg;
558 HACCEL hAccel;
559 WNDCLASSEX wndclass;
560 HMONITOR monitor;
562 INT x, y;
563 RECT rcIntersect;
564 static const TCHAR className[] = _T("Notepad");
565 static const TCHAR winName[] = _T("Notepad");
566
567 switch (GetUserDefaultUILanguage())
568 {
571 break;
572
573 default:
574 break;
575 }
576
578
580
583
584 ZeroMemory(&wndclass, sizeof(wndclass));
585 wndclass.cbSize = sizeof(wndclass);
586 wndclass.lpfnWndProc = NOTEPAD_WndProc;
587 wndclass.hInstance = Globals.hInstance;
589 wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
590 wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
592 wndclass.lpszClassName = className;
593 wndclass.hIconSm = (HICON)LoadImage(hInstance,
598 0);
599 if (!RegisterClassEx(&wndclass))
600 {
602 return 1;
603 }
604
605 /* Setup windows */
606
607 monitor = MonitorFromRect(&Globals.main_rect, MONITOR_DEFAULTTOPRIMARY);
608 info.cbSize = sizeof(info);
609 GetMonitorInfoW(monitor, &info);
610
613 if (!IntersectRect(&rcIntersect, &Globals.main_rect, &info.rcWork))
614 x = y = CW_USEDEFAULT;
615
616 /* Globals.hMainWnd will be set in WM_CREATE handling */
617 CreateWindow(className,
618 winName,
620 x,
621 y,
624 NULL,
625 NULL,
627 NULL);
628 if (!Globals.hMainWnd)
629 {
631 return 1;
632 }
633
636
638 return 0;
639
641
642 while (GetMessage(&msg, NULL, 0, 0))
643 {
646 {
649 }
650 }
651
653
654 return (int) msg.wParam;
655}
#define msg(x)
Definition: auth_time.c:54
static BOOL file_exists(const WCHAR *file_name)
Definition: axinstall.c:70
HWND hWnd
Definition: settings.c:17
#define MAX_STRING_LEN
Definition: precomp.h:36
#define MAIN_MENU
Definition: resources.h:12
#define CMD_DELETE
Definition: resources.h:18
#define CMD_SAVE_AS
Definition: resources.h:16
#define CMD_OPEN
Definition: resources.h:15
#define ID_ACCEL
Definition: resources.h:13
#define CMD_EXIT
Definition: resources.h:17
#define CF_TEXT
Definition: constants.h:396
BOOL DIALOG_FileSaveAs(VOID)
Definition: dialog.c:525
VOID DoShowHideStatusBar(VOID)
Definition: dialog.c:624
VOID DIALOG_StatusBarAlignParts(VOID)
Definition: dialog.c:141
VOID DIALOG_Replace(VOID)
Definition: dialog.c:829
VOID DIALOG_HelpContents(VOID)
Definition: dialog.c:947
VOID DIALOG_StatusBarUpdateCaretPos(VOID)
Definition: dialog.c:924
VOID DIALOG_EditSelectAll(VOID)
Definition: dialog.c:603
VOID DIALOG_FileNew(VOID)
Definition: dialog.c:390
BOOL HasFileExtension(LPCTSTR szFilename)
Definition: dialog.c:234
VOID WaitCursor(BOOL bBegin)
Definition: dialog.c:114
VOID DIALOG_FileExit(VOID)
Definition: dialog.c:573
VOID DIALOG_FileNewWindow(VOID)
Definition: dialog.c:409
VOID DIALOG_EditUndo(VOID)
Definition: dialog.c:578
VOID DIALOG_GoTo(VOID)
Definition: dialog.c:884
VOID DIALOG_ViewStatusBar(VOID)
Definition: dialog.c:941
VOID DIALOG_EditTimeDate(VOID)
Definition: dialog.c:608
VOID DIALOG_FileOpen(VOID)
Definition: dialog.c:421
VOID DoCreateEditWindow(VOID)
Definition: dialog.c:658
static const TCHAR txt_files[]
Definition: dialog.c:22
VOID DIALOG_SelectFont(VOID)
Definition: dialog.c:759
BOOL DIALOG_FileSave(VOID)
Definition: dialog.c:450
VOID ShowLastError(VOID)
Definition: dialog.c:45
VOID DIALOG_Search(VOID)
Definition: dialog.c:811
VOID DIALOG_HelpAboutNotepad(VOID)
Definition: dialog.c:952
BOOL DoCloseFile(VOID)
Definition: dialog.c:305
VOID DIALOG_EditCut(VOID)
Definition: dialog.c:583
VOID DIALOG_EditWrap(VOID)
Definition: dialog.c:749
VOID DIALOG_SearchNext(BOOL bDown)
Definition: dialog.c:816
BOOL FileExists(LPCTSTR szFilename)
Definition: dialog.c:229
VOID DIALOG_EditPaste(VOID)
Definition: dialog.c:593
VOID DIALOG_EditCopy(VOID)
Definition: dialog.c:588
int DIALOG_StringMsgBox(HWND hParent, int formatId, LPCTSTR szString, DWORD dwFlags)
Definition: dialog.c:187
VOID DIALOG_EditDelete(VOID)
Definition: dialog.c:598
VOID DIALOG_FilePrint(VOID)
Definition: printing.c:565
VOID DIALOG_FilePageSetup(VOID)
Definition: printing.c:670
static BOOL NOTEPAD_FindTextAt(FINDREPLACE *pFindReplace, LPCTSTR pszText, INT iTextLength, DWORD dwPosition)
Definition: main.c:94
static BOOL HandleCommandLine(LPTSTR cmdline)
Definition: main.c:463
static VOID NOTEPAD_ReplaceAll(FINDREPLACE *pFindReplace)
Definition: main.c:220
static int NOTEPAD_MenuCommand(WPARAM wParam)
Definition: main.c:49
VOID NOTEPAD_EnableSearchMenu()
Definition: main.c:20
VOID SetFileName(LPCTSTR szFileName)
Definition: main.c:34
LRESULT CALLBACK EDIT_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:294
static int AlertFileDoesNotExist(LPCTSTR szFileName)
Definition: main.c:456
static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:330
static VOID NOTEPAD_InitData(HINSTANCE hInstance)
Definition: main.c:243
static VOID NOTEPAD_FindTerm(VOID)
Definition: main.c:235
BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bShowAlert)
Definition: main.c:132
NOTEPAD_GLOBALS Globals
Definition: main.c:17
static ATOM aFINDMSGSTRING
Definition: main.c:18
static VOID NOTEPAD_InitMenuPopup(HMENU menu, LPARAM index)
Definition: main.c:271
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define FR_WHOLEWORD
Definition: commdlg.h:145
#define GetFileTitle
Definition: commdlg.h:664
#define FR_REPLACE
Definition: commdlg.h:142
#define FR_DIALOGTERM
Definition: commdlg.h:126
#define FR_REPLACEALL
Definition: commdlg.h:143
#define FR_MATCHCASE
Definition: commdlg.h:136
#define FINDMSGSTRING
Definition: commdlg.h:653
#define FR_DOWN
Definition: commdlg.h:127
#define FR_FINDNEXT
Definition: commdlg.h:131
static VOID DoOpenFile(PINFO pInfo)
Definition: connectdialog.c:34
WORD ATOM
Definition: dimm.idl:113
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1374
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:538
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
Definition: shellole.c:522
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
static BOOLEAN bSuccess
Definition: drive.cpp:433
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint index
Definition: glext.h:6031
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean enable
Definition: glext.h:11120
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
#define _tcscmp
Definition: tchar.h:1424
#define _tcscat
Definition: tchar.h:622
#define _tcscpy
Definition: tchar.h:623
#define _tcsncpy
Definition: tchar.h:1410
#define _tWinMain
Definition: tchar.h:498
#define _tcsncmp
Definition: tchar.h:1428
#define _istalnum
Definition: tchar.h:1490
int all_files
Definition: mkisofs.c:132
HACCEL hAccel
Definition: main.c:47
LPCWSTR szPath
Definition: env.c:37
static HICON
Definition: imagelist.c:84
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
static LPCWSTR file_name
Definition: protocol.c:147
void UpdateWindowCaption(HWND hwnd)
Definition: mplay32.c:102
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)
unsigned int UINT
Definition: ndis.h:50
void NOTEPAD_SaveSettingsToRegistry(void)
Definition: settings.c:227
void NOTEPAD_LoadSettingsFromRegistry(void)
Definition: settings.c:105
#define ENCODING_DEFAULT
Definition: notepad.h:49
#define CMD_GOTO
Definition: notepad_res.h:47
#define CMD_PASTE
Definition: notepad_res.h:39
#define CMD_FONT
Definition: notepad_res.h:51
#define CMD_REPLACE
Definition: notepad_res.h:46
#define CMD_SEARCH_PREV
Definition: notepad_res.h:48
#define STRING_DOESNOTEXIST
Definition: notepad_res.h:72
#define CMD_SELECT_ALL
Definition: notepad_res.h:41
#define CMD_COPY
Definition: notepad_res.h:38
#define CMD_SAVE
Definition: notepad_res.h:30
#define CMD_WRAP
Definition: notepad_res.h:50
#define STRING_ALL_FILES
Definition: notepad_res.h:68
#define CMD_NEW
Definition: notepad_res.h:27
#define CMD_UNDO
Definition: notepad_res.h:36
#define STRING_CANNOTFIND
Definition: notepad_res.h:77
#define CMD_HELP_CONTENTS
Definition: notepad_res.h:56
#define CMD_PAGE_SETUP
Definition: notepad_res.h:33
#define CMD_NEW_WINDOW
Definition: notepad_res.h:28
#define CMD_HELP_ABOUT_NOTEPAD
Definition: notepad_res.h:57
#define CMD_SEARCH
Definition: notepad_res.h:44
#define CMD_TIME_DATE
Definition: notepad_res.h:42
#define CMD_SEARCH_NEXT
Definition: notepad_res.h:45
#define STRING_NOTEPAD
Definition: notepad_res.h:63
#define IDI_NPICON
Definition: notepad_res.h:19
#define STRING_TEXT_FILES_TXT
Definition: notepad_res.h:69
#define CMD_STATUSBAR
Definition: notepad_res.h:53
#define CMD_CUT
Definition: notepad_res.h:37
#define CMD_PRINT
Definition: notepad_res.h:32
#define DWORD
Definition: nt_native.h:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define LOWORD(l)
Definition: pedump.c:82
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define EM_SCROLLCARET
Definition: richedit.h:81
#define DefWindowProc
Definition: ros2win.h:31
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_HEBREW
Definition: nls.h:67
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define DragQueryFile
Definition: shellapi.h:686
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
Definition: shellord.c:813
#define SHARD_PATHW
Definition: shlobj.h:1169
#define _countof(array)
Definition: sndvol32.h:70
TCHAR * cmdline
Definition: stretchblt.cpp:32
#define StringCchCopy
Definition: strsafe.h:139
#define StringCchPrintf
Definition: strsafe.h:517
LPSTR lpstrFindWhat
Definition: commdlg.h:307
LPSTR lpstrReplaceWith
Definition: commdlg.h:308
DWORD Flags
Definition: commdlg.h:306
HGLOBAL hDevNames
Definition: notepad.h:68
BOOL bWrapLongLines
Definition: notepad.h:70
HWND hFindReplaceDlg
Definition: notepad.h:62
HWND hStatusBar
Definition: notepad.h:64
BOOL bShowStatusBar
Definition: notepad.h:71
ENCODING encFile
Definition: notepad.h:82
WNDPROC EditProc
Definition: notepad.h:86
TCHAR szFileName[MAX_PATH]
Definition: notepad.h:74
HGLOBAL hDevMode
Definition: notepad.h:67
FINDREPLACE find
Definition: notepad.h:85
HMENU hMenu
Definition: notepad.h:66
HINSTANCE hInstance
Definition: notepad.h:60
HFONT hFont
Definition: notepad.h:65
TCHAR szFileTitle[MAX_PATH]
Definition: notepad.h:75
TCHAR szFilter[512]
Definition: notepad.h:76
HWND hMainWnd
Definition: notepad.h:61
RECT main_rect
Definition: notepad.h:87
HINSTANCE hInstance
Definition: winuser.h:3206
HCURSOR hCursor
Definition: winuser.h:3208
LPCSTR lpszMenuName
Definition: winuser.h:3210
HICON hIconSm
Definition: winuser.h:3212
UINT cbSize
Definition: winuser.h:3201
WNDPROC lpfnWndProc
Definition: winuser.h:3203
LPCSTR lpszClassName
Definition: winuser.h:3211
HICON hIcon
Definition: winuser.h:3207
HBRUSH hbrBackground
Definition: winuser.h:3209
Definition: getopt.h:109
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
#define _T(x)
Definition: vfdio.h:22
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1719
#define ZeroMemory
Definition: winbase.h:1712
#define lstrlen
Definition: winbase.h:3876
#define GetFullPathName
Definition: winbase.h:3821
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WINAPI
Definition: msvc.h:6
#define LAYOUT_RTL
Definition: wingdi.h:1371
#define WM_ERASEBKGND
Definition: winuser.h:1625
#define WM_CLOSE
Definition: winuser.h:1621
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define WM_KEYUP
Definition: winuser.h:1716
#define COLOR_WINDOW
Definition: winuser.h:918
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CallWindowProc
Definition: winuser.h:5735
#define IsDialogMessage
Definition: winuser.h:5809
#define IMAGE_ICON
Definition: winuser.h:212
#define GetWindowTextLength
Definition: winuser.h:5799
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1608
#define EM_GETSEL
Definition: winuser.h:1997
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1611
#define WM_DROPFILES
Definition: winuser.h:1825
#define WM_COMMAND
Definition: winuser.h:1740
#define EM_REPLACESEL
Definition: winuser.h:2006
#define IDC_ARROW
Definition: winuser.h:687
#define SM_CYSMICON
Definition: winuser.h:1013
#define VK_UP
Definition: winuser.h:2225
#define WM_SETFOCUS
Definition: winuser.h:1613
#define MF_CHECKED
Definition: winuser.h:132
#define MB_YESNO
Definition: winuser.h:817
#define EN_HSCROLL
Definition: winuser.h:2024
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define CreateWindow
Definition: winuser.h:5754
#define EM_CANUNDO
Definition: winuser.h:1983
#define GetMessage
Definition: winuser.h:5790
#define SM_CXSMICON
Definition: winuser.h:1012
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define RegisterClassEx
Definition: winuser.h:5837
HWND WINAPI SetFocus(_In_opt_ HWND)
#define WM_INITMENUPOPUP
Definition: winuser.h:1746
#define MF_ENABLED
Definition: winuser.h:128
#define RegisterWindowMessage
Definition: winuser.h:5840
#define WM_QUERYENDSESSION
Definition: winuser.h:1622
#define IDNO
Definition: winuser.h:836
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define LoadIcon
Definition: winuser.h:5813
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SendMessage
Definition: winuser.h:5843
#define LoadCursor
Definition: winuser.h:5812
#define EM_SETSEL
Definition: winuser.h:2018
int WINAPI GetWindowTextLengthW(_In_ HWND)
#define MB_ICONEXCLAMATION
Definition: winuser.h:785
#define MB_OK
Definition: winuser.h:790
#define WM_LBUTTONUP
Definition: winuser.h:1777
#define GetWindowText
Definition: winuser.h:5798
#define CW_USEDEFAULT
Definition: winuser.h:225
#define LoadImage
Definition: winuser.h:5815
#define VK_LEFT
Definition: winuser.h:2224
#define VK_RIGHT
Definition: winuser.h:2226
#define LoadString
Definition: winuser.h:5819
#define EN_VSCROLL
Definition: winuser.h:2029
#define VK_DOWN
Definition: winuser.h:2227
#define MessageBox
Definition: winuser.h:5822
#define WM_DESTROY
Definition: winuser.h:1609
#define WM_KEYDOWN
Definition: winuser.h:1715
#define DispatchMessage
Definition: winuser.h:5765
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define IDYES
Definition: winuser.h:835
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
#define TranslateAccelerator
Definition: winuser.h:5860
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCE
Definition: winuser.h:591
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI IsClipboardFormatAvailable(_In_ UINT)
#define LoadAccelerators
Definition: winuser.h:5810
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define MF_GRAYED
Definition: winuser.h:129
#define EN_CHANGE
Definition: winuser.h:2022
char TCHAR
Definition: xmlstorage.h:189
#define _tcsnicmp
Definition: xmlstorage.h:207
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define _tcslen
Definition: xmlstorage.h:198