/
Notepad_plus.h
651 lines (519 loc) · 19.1 KB
/
Notepad_plus.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
// This file is part of Notepad++ project
// Copyright (C)2003 Don HO <don.h@free.fr>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// Note that the GPL places important restrictions on "derived works", yet
// it does not provide a detailed definition of that term. To avoid
// misunderstandings, we consider an application to constitute a
// "derivative work" for the purpose of this license if it does any of the
// following:
// 1. Integrates source code from Notepad++.
// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable
// installer, such as those produced by InstallShield.
// 3. Links to a library or executes a program that does any of the above.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#ifndef NOTEPAD_PLUS_H
#define NOTEPAD_PLUS_H
#ifndef SCINTILLA_EDIT_VIEW_H
#include "ScintillaEditView.h"
#endif //SCINTILLA_EDIT_VIEW_H
#ifndef DOCTABVIEW_H
#include "DocTabView.h"
#endif //DOCTABVIEW_H
#ifndef SPLITTER_CONTAINER_H
#include "SplitterContainer.h"
#endif //SPLITTER_CONTAINER_H
#ifndef FIND_REPLACE_DLG_H
#include "FindReplaceDlg.h"
#endif //FIND_REPLACE_DLG_H
#ifndef ABOUT_DLG_H
#include "AboutDlg.h"
#endif //ABOUT_DLG_H
#ifndef RUN_DLG_H
#include "RunDlg.h"
#endif //RUN_DLG_H
#ifndef STATUS_BAR_H
#include "StatusBar.h"
#endif //STATUS_BAR_H
#ifndef LASTRECENTFILELIST_H
#include "lastRecentFileList.h"
#endif //LASTRECENTFILELIST_H
#ifndef GOTILINE_DLG_H
#include "GoToLineDlg.h"
#endif //GOTILINE_DLG_H
#ifndef FINDCHARSINRANGE_DLG_H
#include "FindCharsInRange.h"
#endif //FINDCHARSINRANGE_DLG_H
#ifndef COLUMNEDITOR_H
#include "columnEditor.h"
#endif //COLUMNEDITOR_H
#ifndef WORD_STYLE_H
#include "WordStyleDlg.h"
#endif //WORD_STYLE_H
#ifndef TRAY_ICON_CONTROLER_H
#include "trayIconControler.h"
#endif //TRAY_ICON_CONTROLER_H
#ifndef PLUGINSMANAGER_H
#include "PluginsManager.h"
#endif //PLUGINSMANAGER_H
/*
#ifndef NOTEPAD_PLUS_MSGS_H
#include "Notepad_plus_msgs.h"
#endif //NOTEPAD_PLUS_MSGS_H
*/
#ifndef PREFERENCE_DLG_H
#include "preferenceDlg.h"
#endif //PREFERENCE_DLG_H
#ifndef WINDOWS_DLG_H
#include "WindowsDlg.h"
#endif //WINDOWS_DLG_H
#ifndef RUN_MACRO_DLG_H
#include "RunMacroDlg.h"
#endif //RUN_MACRO_DLG_H
#ifndef DOCKINGMANAGER_H
#include "DockingManager.h"
#endif //DOCKINGMANAGER_H
#ifndef PROCESSUS_H
#include "Process.h"
#endif //PROCESSUS_H
#ifndef AUTOCOMPLETION_H
#include "AutoCompletion.h"
#endif //AUTOCOMPLETION_H
#ifndef SMARTHIGHLIGHTER_H
#include "SmartHighlighter.h"
#endif //SMARTHIGHLIGHTER_H
#ifndef SCINTILLACTRLS_H
#include "ScintillaCtrls.h"
#endif //SCINTILLACTRLS_H
#ifndef SIZE_DLG_H
#include "lesDlgs.h"
#endif //SIZE_DLG_H
#include "localization.h"
#include <vector>
#define MENU 0x01
#define TOOLBAR 0x02
#define URL_REG_EXPR "[A-Za-z]+://[A-Za-z0-9_\\-\\+~.:?&@=/%#,;\\{\\}\\(\\)\\[\\]\\|\\*\\!\\\\]+"
enum FileTransferMode {
TransferClone = 0x01,
TransferMove = 0x02
};
enum WindowStatus { //bitwise mask
WindowMainActive = 0x01,
WindowSubActive = 0x02,
WindowBothActive = 0x03, //little helper shortcut
WindowUserActive = 0x04,
WindowMask = 0x07
};
enum trimOp {
lineHeader = 0,
lineTail = 1,
lineEol = 2
};
enum spaceTab {
tab2Space = 0,
space2TabLeading = 1,
space2TabAll = 2
};
struct TaskListInfo;
struct VisibleGUIConf {
bool isPostIt;
bool isFullScreen;
//Used by both views
bool isMenuShown;
//bool isToolbarShown; //toolbar forcefully hidden by hiding rebar
DWORD_PTR preStyle;
//used by postit only
bool isTabbarShown;
bool isAlwaysOnTop;
bool isStatusbarShown;
//used by fullscreen only
WINDOWPLACEMENT _winPlace;
VisibleGUIConf() : isPostIt(false), isFullScreen(false),
isAlwaysOnTop(false), isMenuShown(true), isTabbarShown(true),
isStatusbarShown(true), preStyle(WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN)
{
_winPlace.length = 0;
};
};
class FileDialog;
class Notepad_plus_Window;
class AnsiCharPanel;
class ClipboardHistoryPanel;
class VerticalFileSwitcher;
class ProjectPanel;
class DocumentMap;
class FunctionListPanel;
class Notepad_plus {
friend class Notepad_plus_Window;
public:
Notepad_plus();
virtual ~Notepad_plus();
LRESULT init(HWND hwnd);
LRESULT process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
void killAllChildren();
/*
HWND getWindowHandle() const {
return _pPublicInterface->getHSelf();
};
*/
enum comment_mode {cm_comment, cm_uncomment, cm_toggle};
void setTitle();
void getTaskListInfo(TaskListInfo *tli);
// For filtering the modeless Dialog message
// fileOperations
//The doXXX functions apply to a single buffer and dont need to worry about views, with the excpetion of doClose, since closing one view doesnt have to mean the document is gone
BufferID doOpen(const TCHAR *fileName, bool isRecursive = false, bool isReadOnly = false, int encoding = -1);
bool doReload(BufferID id, bool alert = true);
bool doSave(BufferID, const TCHAR * filename, bool isSaveCopy = false);
void doClose(BufferID, int whichOne, bool doDeleteBackup = false);
//bool doDelete(const TCHAR *fileName) const {return ::DeleteFile(fileName) != 0;};
void fileOpen();
void fileNew();
bool fileReload() {
BufferID buf = _pEditView->getCurrentBufferID();
return doReload(buf, buf->isDirty());
};
bool fileClose(BufferID id = BUFFER_INVALID, int curView = -1); //use curView to override view to close from
bool fileCloseAll(bool doDeleteBackup);
bool fileCloseAllButCurrent();
bool fileCloseAllGiven(const std::vector<int> &krvecBufferIndexes);
bool fileCloseAllToLeft();
bool fileCloseAllToRight();
bool fileSave(BufferID id = BUFFER_INVALID);
bool fileSaveAll();
bool fileSaveAs(BufferID id = BUFFER_INVALID, bool isSaveCopy = false);
bool fileDelete(BufferID id = BUFFER_INVALID);
bool fileRename(BufferID id = BUFFER_INVALID);
bool addBufferToView(BufferID id, int whichOne);
bool moveBuffer(BufferID id, int whereTo); //assumes whereFrom is otherView(whereTo)
bool switchToFile(BufferID buffer); //find buffer in active view then in other view.
// end fileOperations
bool isFileSession(const TCHAR * filename);
void filePrint(bool showDialog);
bool saveScintillaParams();
bool saveGUIParams();
bool saveProjectPanelsParams();
void saveDockingParams();
void saveUserDefineLangs() {
if (ScintillaEditView::getUserDefineDlg()->isDirty())
(NppParameters::getInstance())->writeUserDefinedLang();
};
void saveShortcuts(){
NppParameters::getInstance()->writeShortcuts();
};
void saveSession(const Session & session);
void saveFindHistory(){
_findReplaceDlg.saveFindHistory();
(NppParameters::getInstance())->writeFindHistory();
};
void getCurrentOpenedFiles(Session & session);
bool fileLoadSession(const TCHAR *fn = NULL);
const TCHAR * fileSaveSession(size_t nbFile, TCHAR ** fileNames, const TCHAR *sessionFile2save);
const TCHAR * fileSaveSession(size_t nbFile = 0, TCHAR ** fileNames = NULL);
void changeToolBarIcons();
bool doBlockComment(comment_mode currCommentMode);
bool doStreamComment();
//--FLS: undoStreamComment: New function unDoStreamComment()
bool undoStreamComment();
bool addCurrentMacro();
void macroPlayback(Macro);
void loadLastSession(){
Session lastSession = (NppParameters::getInstance())->getSession();
loadSession(lastSession);
};
bool loadSession(Session & session);
void notifyBufferChanged(Buffer * buffer, int mask);
bool findInFiles();
bool replaceInFiles();
void setFindReplaceFolderFilter(const TCHAR *dir, const TCHAR *filters);
vector<generic_string> addNppComponents(const TCHAR *destDir, const TCHAR *extFilterName, const TCHAR *extFilter);
int getHtmlXmlEncoding(const TCHAR *fileName) const;
HACCEL getAccTable() const{
return _accelerator.getAccTable();
};
bool emergency(generic_string emergencySavedDir);
Buffer * getCurrentBuffer() {
return _pEditView->getCurrentBuffer();
};
void launchDocumentBackupTask();
private:
Notepad_plus_Window *_pPublicInterface;
Window *_pMainWindow;
DockingManager _dockingManager;
vector<int> _internalFuncIDs;
AutoCompletion _autoCompleteMain;
AutoCompletion _autoCompleteSub; //each Scintilla has its own autoComplete
SmartHighlighter _smartHighlighter;
NativeLangSpeaker _nativeLangSpeaker;
DocTabView _mainDocTab;
DocTabView _subDocTab;
DocTabView *_pDocTab;
DocTabView *_pNonDocTab;
ScintillaEditView _subEditView;
ScintillaEditView _mainEditView;
ScintillaEditView _invisibleEditView; //for searches
ScintillaEditView _fileEditView; //for FileManager
ScintillaEditView *_pEditView;
ScintillaEditView *_pNonEditView;
SplitterContainer *_pMainSplitter;
SplitterContainer _subSplitter;
ContextMenu _tabPopupMenu, _tabPopupDropMenu, _fileSwitcherMultiFilePopupMenu;
ToolBar _toolBar;
IconList _docTabIconList;
StatusBar _statusBar;
bool _toReduceTabBar;
ReBar _rebarTop;
ReBar _rebarBottom;
// Dialog
FindReplaceDlg _findReplaceDlg;
FindIncrementDlg _incrementFindDlg;
AboutDlg _aboutDlg;
RunDlg _runDlg;
GoToLineDlg _goToLineDlg;
ColumnEditorDlg _colEditorDlg;
WordStyleDlg _configStyleDlg;
PreferenceDlg _preference;
FindCharsInRangeDlg _findCharsInRangeDlg;
// a handle list of all the Notepad++ dialogs
vector<HWND> _hModelessDlgs;
LastRecentFileList _lastRecentFileList;
//vector<iconLocator> _customIconVect;
WindowsMenu _windowsMenu;
HMENU _mainMenuHandle;
bool _sysMenuEntering;
// For FullScreen/PostIt features
VisibleGUIConf _beforeSpecialView;
void fullScreenToggle();
void postItToggle();
// Keystroke macro recording and playback
Macro _macro;
bool _recordingMacro;
RunMacroDlg _runMacroDlg;
// For hotspot
bool _linkTriggered;
bool _isHotspotDblClicked;
bool _isFolding;
//For Dynamic selection highlight
CharacterRange _prevSelectedRange;
struct ActivateAppInfo {
bool _isActivated;
int _x;
int _y;
ActivateAppInfo() : _isActivated(false), _x(0), _y(0){};
} _activeAppInf;
//Synchronized Scolling
struct SyncInfo {
int _line;
int _column;
bool _isSynScollV;
bool _isSynScollH;
SyncInfo():_line(0), _column(0), _isSynScollV(false), _isSynScollH(false){};
bool doSync() const {return (_isSynScollV || _isSynScollH); };
} _syncInfo;
bool _isUDDocked;
trayIconControler *_pTrayIco;
int _zoomOriginalValue;
Accelerator _accelerator;
ScintillaAccelerator _scintaccelerator;
PluginsManager _pluginsManager;
ButtonDlg _restoreButton;
bool _isFileOpening;
bool _isAdministrator;
ScintillaCtrls _scintillaCtrls4Plugins;
vector<pair<int, int> > _hideLinesMarks;
StyleArray _hotspotStyles;
bool _rememberThisSession; // always true. except -nosession is indicated on the launch time
AnsiCharPanel *_pAnsiCharPanel;
ClipboardHistoryPanel *_pClipboardHistoryPanel;
VerticalFileSwitcher *_pFileSwitcherPanel;
ProjectPanel *_pProjectPanel_1;
ProjectPanel *_pProjectPanel_2;
ProjectPanel *_pProjectPanel_3;
DocumentMap *_pDocMap;
FunctionListPanel *_pFuncList;
BOOL notify(SCNotification *notification);
void specialCmd(int id);
void command(int id);
//Document management
UCHAR _mainWindowStatus; //For 2 views and user dialog if docked
int _activeView;
//User dialog docking
void dockUserDlg();
void undockUserDlg();
//View visibility
void showView(int whichOne);
bool viewVisible(int whichOne);
void hideView(int whichOne);
void hideCurrentView();
bool bothActive() { return (_mainWindowStatus & WindowBothActive) == WindowBothActive; };
bool reloadLang();
bool loadStyles();
int currentView(){
return _activeView;
};
int otherView(){
return (_activeView == MAIN_VIEW?SUB_VIEW:MAIN_VIEW);
};
int otherFromView(int whichOne){
return (whichOne == MAIN_VIEW?SUB_VIEW:MAIN_VIEW);
};
bool canHideView(int whichOne); //true if view can safely be hidden (no open docs etc)
int switchEditViewTo(int gid); //activate other view (set focus etc)
void docGotoAnotherEditView(FileTransferMode mode); //TransferMode
void docOpenInNewInstance(FileTransferMode mode, int x = 0, int y = 0);
void loadBufferIntoView(BufferID id, int whichOne, bool dontClose = false); //Doesnt _activate_ the buffer
bool removeBufferFromView(BufferID id, int whichOne); //Activates alternative of possible, or creates clean document if not clean already
bool activateBuffer(BufferID id, int whichOne); //activate buffer in that view if found
void notifyBufferActivated(BufferID bufid, int view);
void performPostReload(int whichOne);
//END: Document management
int doSaveOrNot(const TCHAR *fn);
int doReloadOrNot(const TCHAR *fn, bool dirty);
int doCloseOrNot(const TCHAR *fn);
int doDeleteOrNot(const TCHAR *fn);
int doActionOrNot(const TCHAR *title, const TCHAR *displayText, int type);
void enableMenu(int cmdID, bool doEnable) const;
void enableCommand(int cmdID, bool doEnable, int which) const;
void checkClipboard();
void checkDocState();
void checkUndoState();
void checkMacroState();
void checkSyncState();
void dropFiles(HDROP hdrop);
void checkModifiedDocument();
void getMainClientRect(RECT & rc) const;
void staticCheckMenuAndTB() const;
void dynamicCheckMenuAndTB() const;
void enableConvertMenuItems(formatType f) const;
void checkUnicodeMenuItems() const;
generic_string getLangDesc(LangType langType, bool getName = false);
void setLangStatus(LangType langType){
_statusBar.setText(getLangDesc(langType).c_str(), STATUSBAR_DOC_TYPE);
};
void setDisplayFormat(formatType f);
int getCmdIDFromEncoding(int encoding) const;
void setUniModeText();
void checkLangsMenu(int id) const ;
void setLanguage(LangType langType);
enum LangType menuID2LangType(int cmdID);
void checkMenuItem(int itemID, bool willBeChecked) const {
::CheckMenuItem(_mainMenuHandle, itemID, MF_BYCOMMAND | (willBeChecked?MF_CHECKED:MF_UNCHECKED));
};
void MaintainIndentation(TCHAR ch);
void addHotSpot();
void bookmarkAdd(int lineno) const {
if (lineno == -1)
lineno = _pEditView->getCurrentLineNumber();
if (!bookmarkPresent(lineno))
_pEditView->execute(SCI_MARKERADD, lineno, MARK_BOOKMARK);
};
void bookmarkDelete(int lineno) const {
if (lineno == -1)
lineno = _pEditView->getCurrentLineNumber();
if ( bookmarkPresent(lineno))
_pEditView->execute(SCI_MARKERDELETE, lineno, MARK_BOOKMARK);
};
bool bookmarkPresent(int lineno) const {
if (lineno == -1)
lineno = _pEditView->getCurrentLineNumber();
LRESULT state = _pEditView->execute(SCI_MARKERGET, lineno);
return ((state & (1 << MARK_BOOKMARK)) != 0);
};
void bookmarkToggle(int lineno) const {
if (lineno == -1)
lineno = _pEditView->getCurrentLineNumber();
if (bookmarkPresent(lineno))
bookmarkDelete(lineno);
else
bookmarkAdd(lineno);
};
void bookmarkNext(bool forwardScan);
void bookmarkClearAll() const {
_pEditView->execute(SCI_MARKERDELETEALL, MARK_BOOKMARK);
};
void copyMarkedLines();
void cutMarkedLines();
void deleteMarkedLines(bool isMarked);
void pasteToMarkedLines();
void deleteMarkedline(int ln);
void inverseMarks();
void replaceMarkedline(int ln, const TCHAR *str);
generic_string getMarkedLine(int ln);
void findMatchingBracePos(int & braceAtCaret, int & braceOpposite);
bool braceMatch();
void activateNextDoc(bool direction);
void activateDoc(int pos);
void updateStatusBar();
size_t getSelectedCharNumber(UniMode);
size_t getCurrentDocCharCount(UniMode u);
int getSelectedAreas();
size_t getSelectedBytes();
bool isFormatUnicode(UniMode);
int getBOMSize(UniMode);
void showAutoComp();
void autoCompFromCurrentFile(bool autoInsert = true);
void showFunctionComp();
void showPathCompletion();
//void changeStyleCtrlsLang(HWND hDlg, int *idArray, const char **translatedText);
bool replaceInOpenedFiles();
bool findInOpenedFiles();
bool findInCurrentFile();
bool matchInList(const TCHAR *fileName, const vector<generic_string> & patterns);
void getMatchedFileNames(const TCHAR *dir, const vector<generic_string> & patterns, vector<generic_string> & fileNames, bool isRecursive, bool isInHiddenDir);
void doSynScorll(HWND hW);
void setWorkingDir(const TCHAR *dir);
bool str2Cliboard(const TCHAR *str2cpy);
bool bin2Cliboard(const UCHAR *uchar2cpy, size_t length);
bool getIntegralDockingData(tTbData & dockData, int & iCont, bool & isVisible);
int getLangFromMenuName(const TCHAR * langName);
generic_string getLangFromMenu(const Buffer * buf);
generic_string Notepad_plus::exts2Filters(generic_string exts) const;
int setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType = -1);
void markSelectedTextInc(bool enable);
Style * getStyleFromName(const TCHAR *styleName);
bool dumpFiles(const TCHAR * outdir, const TCHAR * fileprefix = TEXT("")); //helper func
void drawTabbarColoursFromStylerArray();
void loadCommandlineParams(const TCHAR * commandLine, CmdLineParams * pCmdParams);
bool noOpenedDoc() const;
bool goToPreviousIndicator(int indicID2Search, bool isWrap = true) const;
bool goToNextIndicator(int indicID2Search, bool isWrap = true) const;
int wordCount();
void wsTabConvert(spaceTab whichWay);
void doTrim(trimOp whichPart);
void removeEmptyLine(bool isBlankContained);
void launchAnsiCharPanel();
void launchClipboardHistoryPanel();
void launchFileSwitcherPanel();
void launchProjectPanel(int cmdID, ProjectPanel ** pProjPanel, int panelID);
void launchDocMap();
void launchFunctionList();
int getQuoteIndexFrom(const char *quoter) const;
void showQuoteFromIndex(int index) const;
void showAllQuotes() const;
static DWORD WINAPI threadTextPlayer(void *text2display);
static DWORD WINAPI threadTextTroller(void *params);
static int getRandomAction(int ranNum);
static bool deleteBack(ScintillaEditView *pCurrentView, BufferID targetBufID);
static bool deleteForward(ScintillaEditView *pCurrentView, BufferID targetBufID);
static bool selectBack(ScintillaEditView *pCurrentView, BufferID targetBufID);
static int getRandomNumber(int rangeMax = -1) {
int randomNumber = rand();
if (rangeMax == -1)
return randomNumber;
return (rand() % rangeMax);
};
static DWORD WINAPI backupDocument(void *params);
};
#endif //NOTEPAD_PLUS_H