├── .gitignore
├── .gitmodules
├── BookmarkEdition.txt
├── License.txt
├── Makefile
├── Notepad2.ini
├── Notepad2.txt
├── Readme.flo.txt
├── inc
└── winres.h
├── nsis
└── notepad2.nsi
├── readme.txt
├── res
├── Copy.cur
├── Encoding.bmp
├── Next.bmp
├── Notepad2.ico
├── Open.bmp
├── Pick.bmp
├── Prev.bmp
├── Run.ico
├── Styles.ico
└── Toolbar.bmp
├── src
├── Dialogs.c
├── Dialogs.h
├── Dlapi.c
├── Dlapi.h
├── Edit.c
├── Edit.h
├── Helpers.c
├── Helpers.h
├── Notepad2.c
├── Notepad2.h
├── Notepad2.rc
├── Print.cpp
├── Styles.c
├── Styles.h
├── resource.h
└── scicall.h
└── todo.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "scintilla"]
2 | path = scintilla
3 | url = git://github.com/djs/notepad2-scintilla.git
4 |
--------------------------------------------------------------------------------
/BookmarkEdition.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/BookmarkEdition.txt
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/License.txt
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 |
2 | DIR_O=obj
3 | DIR_BIN=bin
4 |
5 | CC=cl
6 | RC=rc
7 | LD=link
8 |
9 | EXE=$(DIR_BIN)\notepad2.exe
10 |
11 | CXXFLAGS=-Zi -W3 -EHsc -D_CRT_SECURE_NO_DEPRECATE=1 -D_UNICODE -DUNICODE -DSTATIC_BUILD -DSCI_LEXER -DBOOKMARK_EDITION
12 | CXXDEBUG=-Od -MTd -DDEBUG
13 | CXXNDEBUG=-O2 -MT -DNDEBUG -GL
14 | NAME=-Fo
15 | MANIFEST=-"manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
16 | processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
17 | LDFLAGS=-OPT:REF -DEBUG $(MANIFEST)
18 | LDDEBUG=
19 | LDNDEBUG=-LTCG
20 | LIBS=kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib shlwapi.lib comdlg32.lib comctl32.lib winspool.lib imm32.lib ole32.lib oleaut32.lib psapi.lib
21 | NOLOGO=-nologo
22 |
23 |
24 | !IFDEF DEBUG
25 | CXXFLAGS=$(CXXFLAGS) $(CXXDEBUG) $(NOLOGO)
26 | LDFLAGS=$(LDDEBUG) $(LDFLAGS) $(NOLOGO)
27 | !ELSE
28 | CXXFLAGS=$(CXXFLAGS) $(CXXNDEBUG) $(NOLOGO)
29 | LDFLAGS=$(LDNDEBUG) $(LDFLAGS) $(NOLOGO)
30 | !ENDIF
31 |
32 | SCINTILLA_INCLUDEDIRS=-I "scintilla\include" -I "scintilla\src" -I "scintilla\win32"
33 | INCLUDEDIRS=-Isrc -Iinc $(SCINTILLA_INCLUDEDIRS)
34 | CXXFLAGS=$(CXXFLAGS) $(INCLUDEDIRS)
35 |
36 |
37 | ALL: $(EXE)
38 |
39 | clean:
40 | -del /q $(DIR_O)\*.obj $(DIR_O)\*.pdb $(EXE) \
41 | $(DIR_O)\*.res $(DIR_BIN)\*.map $(DIR_BIN)\*.exp $(DIR_BIN)\*.pdb $(DIR_BIN)\*.lib $(DIR_BIN)\*.manifest
42 |
43 |
44 |
45 | ################################################################################
46 | # Scintilla Definitions
47 | ################################################################################
48 |
49 | OBJS=$(DIR_O)\Dialogs.obj \
50 | $(DIR_O)\Dlapi.obj \
51 | $(DIR_O)\Edit.obj \
52 | $(DIR_O)\Helpers.obj \
53 | $(DIR_O)\Notepad2.obj \
54 | $(DIR_O)\Print.obj \
55 | $(DIR_O)\Styles.obj \
56 | $(DIR_O)\Notepad2.res \
57 | scintilla\win32\ScintillaWinL.obj \
58 | scintilla\win32\AutoComplete.obj \
59 | scintilla\win32\CallTip.obj \
60 | scintilla\win32\CellBuffer.obj \
61 | scintilla\win32\CharClassify.obj \
62 | scintilla\win32\ContractionState.obj \
63 | scintilla\win32\Decoration.obj \
64 | scintilla\win32\Document.obj \
65 | scintilla\win32\DocumentAccessor.obj \
66 | scintilla\win32\Editor.obj \
67 | scintilla\win32\ExternalLexer.obj \
68 | scintilla\win32\Indicator.obj \
69 | scintilla\win32\KeyMap.obj \
70 | scintilla\win32\KeyWords.obj \
71 | scintilla\win32\LineMarker.obj \
72 | scintilla\win32\PerLine.obj \
73 | scintilla\win32\PlatWin.obj \
74 | scintilla\win32\PositionCache.obj \
75 | scintilla\win32\PropSet.obj \
76 | scintilla\win32\RESearch.obj \
77 | scintilla\win32\RunStyles.obj \
78 | scintilla\win32\ScintillaBaseL.obj \
79 | scintilla\win32\Selection.obj \
80 | scintilla\win32\Style.obj \
81 | scintilla\win32\StyleContext.obj \
82 | scintilla\win32\UniConversion.obj \
83 | scintilla\win32\ViewStyle.obj \
84 | scintilla\win32\XPM.obj \
85 | scintilla\win32\LexAbaqus.obj \
86 | scintilla\win32\LexAda.obj \
87 | scintilla\win32\LexAPDL.obj \
88 | scintilla\win32\LexAsm.obj \
89 | scintilla\win32\LexAsn1.obj \
90 | scintilla\win32\LexASY.obj \
91 | scintilla\win32\LexAU3.obj \
92 | scintilla\win32\LexAVE.obj \
93 | scintilla\win32\LexBaan.obj \
94 | scintilla\win32\LexBash.obj \
95 | scintilla\win32\LexBasic.obj \
96 | scintilla\win32\LexBullant.obj \
97 | scintilla\win32\LexCaml.obj \
98 | scintilla\win32\LexCLW.obj \
99 | scintilla\win32\LexCmake.obj \
100 | scintilla\win32\LexCOBOL.obj \
101 | scintilla\win32\LexConf.obj \
102 | scintilla\win32\LexCPP.obj \
103 | scintilla\win32\LexCrontab.obj \
104 | scintilla\win32\LexCsound.obj \
105 | scintilla\win32\LexCSS.obj \
106 | scintilla\win32\LexD.obj \
107 | scintilla\win32\LexEiffel.obj \
108 | scintilla\win32\LexErlang.obj \
109 | scintilla\win32\LexEScript.obj \
110 | scintilla\win32\LexFlagship.obj \
111 | scintilla\win32\LexForth.obj \
112 | scintilla\win32\LexFortran.obj \
113 | scintilla\win32\LexGAP.obj \
114 | scintilla\win32\LexGui4Cli.obj \
115 | scintilla\win32\LexHaskell.obj \
116 | scintilla\win32\LexHTML.obj \
117 | scintilla\win32\LexInno.obj \
118 | scintilla\win32\LexKix.obj \
119 | scintilla\win32\LexLisp.obj \
120 | scintilla\win32\LexLout.obj \
121 | scintilla\win32\LexLua.obj \
122 | scintilla\win32\LexMagik.obj \
123 | scintilla\win32\LexMarkdown.obj \
124 | scintilla\win32\LexMatlab.obj \
125 | scintilla\win32\LexMetapost.obj \
126 | scintilla\win32\LexMMIXAL.obj \
127 | scintilla\win32\LexMPT.obj \
128 | scintilla\win32\LexMSSQL.obj \
129 | scintilla\win32\LexMySQL.obj \
130 | scintilla\win32\LexNimrod.obj \
131 | scintilla\win32\LexNsis.obj \
132 | scintilla\win32\LexOpal.obj \
133 | scintilla\win32\LexOthers.obj \
134 | scintilla\win32\LexPascal.obj \
135 | scintilla\win32\LexPB.obj \
136 | scintilla\win32\LexPerl.obj \
137 | scintilla\win32\LexPLM.obj \
138 | scintilla\win32\LexPOV.obj \
139 | scintilla\win32\LexPowerPro.obj \
140 | scintilla\win32\LexPowerShell.obj \
141 | scintilla\win32\LexProgress.obj \
142 | scintilla\win32\LexPS.obj \
143 | scintilla\win32\LexPython.obj \
144 | scintilla\win32\LexR.obj \
145 | scintilla\win32\LexRebol.obj \
146 | scintilla\win32\LexRuby.obj \
147 | scintilla\win32\LexScriptol.obj \
148 | scintilla\win32\LexSmalltalk.obj \
149 | scintilla\win32\LexSML.obj \
150 | scintilla\win32\LexSorcus.obj \
151 | scintilla\win32\LexSpecman.obj \
152 | scintilla\win32\LexSpice.obj \
153 | scintilla\win32\LexSQL.obj \
154 | scintilla\win32\LexTACL.obj \
155 | scintilla\win32\LexTADS3.obj \
156 | scintilla\win32\LexTAL.obj \
157 | scintilla\win32\LexTCL.obj \
158 | scintilla\win32\LexTeX.obj \
159 | scintilla\win32\LexVB.obj \
160 | scintilla\win32\LexVerilog.obj \
161 | scintilla\win32\LexVHDL.obj \
162 | scintilla\win32\LexYAML.obj \
163 |
164 | {src}.c{$(DIR_O)}.obj:
165 | $(CC) $(CXXFLAGS) -c $(NAME)$@ $<
166 |
167 | {src}.cpp{$(DIR_O)}.obj:
168 | $(CC) $(CXXFLAGS) -c $(NAME)$@ $<
169 |
170 |
171 | $(DIR_O)\Notepad2.res : src\Notepad2.rc
172 | $(RC) $(NOLOGO) $(INCLUDEDIRS) -fo$@ $**
173 |
174 | $(EXE): $(OBJS)
175 | $(LD) $(LDFLAGS) -OUT:$@ $** $(LIBS)
176 | @if exist "$@.manifest" \
177 | mt.exe -manifest "$@.manifest" -outputresource:$@;1
178 |
--------------------------------------------------------------------------------
/Notepad2.ini:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/Notepad2.ini
--------------------------------------------------------------------------------
/Notepad2.txt:
--------------------------------------------------------------------------------
1 |
2 | =======================================================================
3 | = =
4 | = =
5 | = Notepad2 - light-weight Scintilla-based text editor for Windows =
6 | = =
7 | = =
8 | = Notepad2 4.1.24 =
9 | = (c) Florian Balmer 2004-2010 =
10 | = http://www.flos-freeware.ch =
11 | = =
12 | = =
13 | =======================================================================
14 |
15 |
16 | Description
17 |
18 | Notepad2 is a light-weight, free and open source Notepad-like text
19 | editor with syntax highlighting for a few commonly used languages.
20 | It's based on the Scintilla source code editing component and works
21 | on NT-based versions of Windows.
22 |
23 |
24 | Features
25 |
26 | - Syntax highlighting: HTML, XML, PHP, ASP (JS, VBS), CSS,
27 | JavaScript, VBScript, C/C++, C#, Resource Script, Makefiles, Java,
28 | Visual Basic, Pascal, Assembly, SQL, Perl, Python, Configuration
29 | Files, Apache Config Files, PowerShell, Batch Files, Diff Files
30 | - Drag & drop text editing inside and outside Notepad2
31 | - Basic regular expression search and replace
32 | - Useful word, line and block editing shortcuts
33 | - Rectangular selection (Alt+Mouse)
34 | - Brace matching, auto indent, long line marker, zoom functions
35 | - Support for Unicode, UTF-8, Unix and Mac text files
36 | - Open shell links
37 | - Mostly adjustable
38 |
39 |
40 | New in Version 4.1.24 (released March 02, 2010)
41 |
42 | - /z command line switch (support registry-based Notepad replacement)
43 | - /u command line switch (launch Notepad2 with elevated privileges)
44 | - Fixed some /p command line switch options not working properly
45 | - Display more informative error messages for file operation failures
46 | - Hotkey to copy pathname of current file to clipboard (Shift+F9)
47 | - Window title indicator when running with elevated privileges
48 | - Ini-options to control system MRU, taskbar and jump list behaviour
49 | - Enhanced portability for directory settings inside My Documents
50 | - Configure whether tab key should reformat indenting whitespace
51 | - Revised word wrap settings dialog and added more detailed options
52 | - New style setting to control font smoothing (see FAQ on my website)
53 | - New style setting to control size of visible white space dots
54 | - Improved cursor visibility on any background color
55 | - Added new "HTML Element Text" and "XML Element Text" styles
56 | - Improved default style utilization for HTML-embedded schemes
57 | - Updated PowerShell keywords to version 2.0
58 | - Added missing keywords to VBScript scheme
59 | - Fixed deleted files reappearing in MRU lists
60 | - Updated Scintilla library to 2.03
61 |
62 |
63 | New in Version 4.0.23 (released October 06, 2009)
64 |
65 | - Added PowerShell Script syntax highlighting
66 | - Added missing keywords to JavaScript schemes
67 | - Further simplified syntax schemes by consolidating certain styles
68 | - More accurate "mode" file variable matching with tightened rules
69 | - Avoid repetitive zone checks when running Notepad2.exe internally
70 | - Fixed choice of encoding conversion prompt being ignored
71 | - Fixed recent file dialog hang with inaccessible UNC paths
72 | - Internal changes to allow complete internationalization (future)
73 |
74 |
75 | New in Version 4.0.22 (released July 28, 2009)
76 |
77 | - Support for numerous Windows, DOS, ISO, Mac and EBCDIC encodings
78 | - Enhanced encoding selection dialog (F9)
79 | - "Recode" (F8) to reload file with different source encoding
80 | - "Recode file as system default ANSI" (Ctrl+Shift+A)
81 | - "Recode file as system default OEM" (Ctrl+Shift+O)
82 | - "Recode 7-bit ASCII file as UTF-8" (Shift+F8)
83 | - Option to load 7-bit ASCII files as UTF-8 (File, Encoding, Default)
84 | - Option to disable encoding tag parsing (File, Encoding, Default)
85 | - Issue warning if data can't be converted to selected file encoding
86 | - Fix loading of (invalid) Unicode files with embedded null bytes
87 | - /e command line switch to specify file source encoding
88 | - "Insert Encoding Identifier" (Ctrl+F8)
89 | - "Tabify Indent" (Ctrl+Alt+T) and "Untabify Indent" (Ctrl+Alt+S)
90 | - "Increase Number" (Ctrl+Alt++) and "Decrease Number" (Ctrl+Alt+-)
91 | - Option to auto-reload unmodified files changed by external programs
92 | - Hotkey (Alt+F5) and auto-reset option for file change notification
93 | - Manual and automatic reloading of files keeps current encoding
94 | - Scroll find matches and jump positions away from bottom border
95 | - Enabled new Scintilla indent modes for wrapped lines
96 | - Option to set any characters as boundaries for word wrap
97 | - Allow bigger tab-/indent-widths (256) and long line limit (4096)
98 | - Allow setting extra line spacing (through "Default Text" scheme)
99 | - Dropping directories displays file open dialog
100 | - Consolidated styles to simplify configuration (patch by Kai Liu)
101 | - Ensure cursor visibility on any background color (patch by Kai Liu)
102 | - Enabled improved Scintilla Pascal lexing module (patch by Kai Liu)
103 | - Updated HTML keywords to version 5.0
104 | - Remapped "Manage Favorites" hotkey to Alt+F9
105 | - Remapped "Invert Case" hotkey to Ctrl+Alt+U
106 | - Remapped "Title Case" hotkey to Ctrl+Alt+I
107 | - Remapped "Sentence Case" hotkey to Ctrl+Alt+O
108 | - Fixed various minor bugs
109 | - Notepad2.exe program file no longer compressed with UPX
110 | - Updated Scintilla library to 1.79
111 |
112 |
113 | New in Version 3.1.21 (released June 21, 2009)
114 |
115 | - No ini-file is created by default (save settings with F7, once)
116 | - "Move Up" and "Move Down" keep selection and work with blocks
117 | - Set cursor to start (Ctrl+,) or end of text selection (Ctrl+.)
118 | - "URL Encode" (Ctrl+Shift+E) and "URL Decode" (Ctrl+Shift+R)
119 | - "Escape" (Ctrl+Alt+E) and "Unescape C Special Chars" (Ctrl+Alt+U)
120 | - "Sort Lines" with several options (Alt+O)
121 | - "Pad With Spaces" block command (Alt+B)
122 | - "Replace Next" assigned to hotkey (F4)
123 | - Auto strip trailing blanks option (File, Line Endings, Default)
124 | - Remapped "Transparent Mode" hotkey to Ctrl+0
125 | - Simple XML detection for files without extensions
126 | - Simple language detection for cgi and fcgi files
127 | - Reload file without file variable parsing (Alt+F8)
128 | - Enabled better styling of C/C++ preprocessor elements
129 | - Recent files and search strings merged with existing items on save
130 | - Paste board mode ignores immediately repeated copy actions
131 | - Command line switch + to accept multiple files (quoted spaces)
132 | - Command line switch - to accept single file argument (no quotes)
133 | - Option to set default command line mode (single or multiple files)
134 | - Command line switches to set file encoding and line ending mode
135 | - More /p command line switches (see "Command Line Switches" below)
136 | - /r command line switch to reuse existing window
137 | - /ns and /rs command line switches to enable single file instance
138 | - Renamed /t command line switch to /d (select default text scheme)
139 | - /t command line switch to set window title
140 | - Set window title to excerpt of current text selection (Ctrl+9)
141 | - Save relative pathnames for recent files (ini-option to disable)
142 | - Save relative directories for "Open with..." and "Favorites"
143 | - "Open with..." no longer sends short pathnames to external programs
144 | - External commands use current file directory as working directory
145 | - Remember "Save Copy" location until exit
146 | - Require only single click to restore window from tray icon
147 | - "Reuse Window" option timeout improves opening multiple files
148 | - Replaced "Find Up" option with "Find Previous" button in dialogs
149 | - "Find Wrap" notification dialogs provide "Cancel" button
150 | - Option to suppress replace count notifications
151 | - Find and replace dialogs provide new system menu commands
152 | - Dialog boxes use correct theme fonts on Vista
153 | - Patches to default styles, file types and auto-detection by Kai Liu
154 | - Incorporated base x64 source code compatibility patch
155 | - Fixed some problems with relative ini-file locations
156 | - Fixed some minor file variable problems
157 | - Fixed some encoding detection issues
158 | - Fixed some find and replace problems
159 | - Fixed several memory leaks when saving files
160 | - Fixed several memory leaks for editing operations
161 | - Reduced size of Notepad2.exe program file
162 |
163 |
164 | New in Version 3.0.20 (released October 31, 2008)
165 |
166 | - Notepad2 converted to a native Win32 Unicode application
167 | - "Copy Add" (Ctrl+E) to append selected text to clipboard
168 | - "Unwrap Paragraphs" (Ctrl+Shift+J)
169 | - "Strip Last Character" (Alt+U)
170 | - "Select Line", can be used repeatedly (Ctrl+Shift+Space)
171 | - Remapped "Delete Line" hotkey to Ctrl+Shift+D
172 | - Remapped "Transparent Mode" hotkey to Alt+O
173 | - Allow easy toggling of find and replace dialogs (Ctrl+F, Ctrl+H)
174 | - Save and restore find and replace dialog positions (Ctrl+O, Ctrl+P)
175 | - Files with UTF-8 Signature always loaded in UTF-8 mode
176 | - Simple HTML detection for files without extensions
177 | - Support basic Emacs file variables (see FAQ on my website)
178 | - Update timestamps (Shift+F5) (see FAQ on my website)
179 | - %APPDATA% searched for existing ini-file
180 | - Modest enhancements to scheme customization dialog
181 | - Improved performance for saving settings to ini-file
182 | - Less restrictive handling of quoted filenames on command line
183 | - Keep scrolling positions when reloading changed files
184 | - Modified /s command line switch to work with extensions, not ids
185 | - /m command line switch to match specified text
186 | - /q command line switch to force creation of new files
187 | - Pass command line switches to existing windows: /s /t /h /x /g /q
188 | - Proceed to next match after choosing "replace" in replace dialog
189 | - Fixed some more find and replace problems
190 | - Improved visual appearance on Windows Vista
191 | - Updated Scintilla library to 1.77
192 |
193 |
194 | New in Version 2.1.19 (released April 10, 2008)
195 |
196 | - "Line Comment" (Ctrl+Q) and "Stream Comment" (Ctrl+Shift+Q)
197 | - "Title Case" (Ctrl+Alt+T) and "Sentence Case" (Ctrl+Alt+S)
198 | - "Compress Whitespace" (Alt+P) command reduces spaces and tabs
199 | - Original Notepad .LOG feature
200 | - /f command line switch to set ini-file (/f0 to omit ini-file)
201 | - /p command line switch trumps sticky window position
202 | - /p0 uses system default settings for new window position
203 | - Move new off-screen windows prior to resizing
204 | - Option to skip Unicode text detection (File, Encoding, Default)
205 | - Reload file with different default encoding (Ctrl+F8, Shift+F8)
206 | - Unsaved documents with just whitespace considered empty
207 | - Improved handling of relative path names
208 | - File dialog filters can be specified in the Notepad2 ini-file
209 | - Type of indent guides can be specified in the Notepad2 ini-file
210 | - Track width of displayed text to adjust horizontal scroll range
211 | - Selected find results are better scrolled into view
212 | - Restore scrolling positions on revert
213 | - Ctrl+Back and Ctrl+Del stop at newlines, as usual on Windows
214 | - Ctrl+Space doesn't select initial line indentation whitespace
215 | - Ctrl+Tab hotkey modified to always insert a tabulator
216 | - Increase (Alt++) and decrease (Alt+-) long lines limit
217 | - Display long lines limit in statusbar if visual marker enabled
218 | - Import and export settings from customization dialog (Alt+I, Alt+X)
219 | - Added "Regular Expression" style to JavaScript and Java schemes
220 | - Updated filename extension lists with more default types
221 | - Updated Python keywords to version 3.0
222 | - Simplified SQL keywords (merged from MySQL and SQLite)
223 | - Improved compatibility with Windows Vista
224 | - Improved visual appearance of toolbar button images
225 | - Print margins can be set to "0"
226 | - Fixed several bugs with regular expression find and replace
227 | - Fixed bug with hanging of recent files dialog
228 | - Fixed bug with charset not being saved properly
229 | - Fixed bug with display of text selection at the beginning of lines
230 | - Fixed bug with cursor movement at start and end of wrapped lines
231 | - Updated Scintilla library to 1.76
232 |
233 |
234 | New in Version 2.0.18 (released July 26, 2007)
235 |
236 | - "Select To" command in find dialog allows expanding the selection
237 | - "Select To Next" (F2) and "Select To Previous" (Shift+F2)
238 | - "Save Find Text" (Alt+F3) for later use with F2, F3, etc.
239 | - "Swap" (Ctrl+K) to exchange selected text with clipboard contents
240 | - Notepad2.exe program file is compressed with UPX by default
241 |
242 |
243 | New in Version 2.0.17 (released July 24, 2007)
244 |
245 | - Option to allow only one Notepad2 window for each file
246 | - Option to display filename in window title in various forms
247 | - Hotkey Shift+Esc to save file and exit Notepad2
248 | - Indent size can be specified separately from tab width
249 | - Indent guides are highlighted along with matching braces
250 | - Caret can be displayed as a block (specify "block" for caret width)
251 | - Find and replace dialogs can be toggled from the toolbar
252 | - Tray icon is restored when Explorer is restarted
253 | - Fixed bug with brace matching
254 | - Fixed bug with replacement of ^c cutting the last character
255 | - Fixed bug with regular expression search causing infinite loop
256 | - Updated Scintilla library to 1.74
257 |
258 |
259 | New in Version 2.0.16 (released May 14, 2007)
260 |
261 | - The msvcr70.dll runtime library is no longer required
262 | - "Enclose Selection" helper tool (Alt+Q)
263 | - Single line files are opened with default line ending mode
264 | - Remapped hotkey Ctrl+Shift+Z from "Undo" to "Redo"
265 | - Remapped hotkey Ctrl+Shift+Y from "Redo" to "Undo"
266 | - Fixed bug: problem with MRU lists causing random crashes
267 | - Fixed bug: moving lines up/down not working properly
268 | - Fixed bug: window settings overwritten on new screen resolution
269 |
270 |
271 | New in Version 2.0.15 (released April 07, 2007)
272 |
273 | - BSD License for Notepad2 and source code (see License.txt)
274 | - "Insert HTML/XML Tag" helper tool (Alt+X)
275 | - Regex support for \d, \D, \s, \S, \w, \W, \xHH
276 | - Text selection can have "eolfilled" style (on by default)
277 | - Caret blink rate is set to system default on startup
278 | - Support for opening makefiles without filename extension
279 | - Dropped Windows 9x support
280 | - Requires msvcr70.dll runtime library
281 | - Updated Scintilla library to 1.73
282 |
283 |
284 | New in Version 2.0.14 (not released to the public)
285 |
286 | - Find and replace dialogs: Don't wrap around on find option
287 | - Use the clipboard contents as the replacement text (enter ^c)
288 | - Date and time formats can be changed using template strings
289 | - "FileCheckInterval" ini-setting (see FAQ on my website)
290 |
291 |
292 | New in Version 2.0.13 (not released to the public)
293 |
294 | - Settings are stored in ini-file
295 | - File change notification (optional)
296 | - Find and replace dialogs are now modeless
297 | - Multiline find and replace through transform backslashes function
298 | - Find next / previous word / selected text (Ctrl+F3, Ctrl+Shift+F3)
299 | - Find and replace dialogs: exclusive options deactivate each other
300 | - Find wrap notification message can be deactivated
301 | - Preview function in scheme customization dialog
302 | - Quickly change the default font (F2)
303 | - Script information is saved along with font settings
304 | - Selection and current line background support transparency
305 | - Open ASCII files as UTF-8 if the default setting is UTF-8
306 | - Open empty files with default encoding and line ending settings
307 | - Don't prompt to save modified empty untitled documents
308 | - Line endings are always converted to current setting on paste
309 | - Ensure consistent line endings option (File, Line Endings, Default)
310 | - NTFS streams are preserved when saving files
311 | - Switching encoding performs proper text conversion to new encoding
312 | - Encoding conversion notification message can be deactivated
313 | - Encoding selection dialog displays info about system ANSI code page
314 | - Downgraded ANSI code page support to system default only
315 | - Big file warning message can be deactivated
316 | - "Wrap Text To Column" command (Ctrl+Shift+W)
317 | - "Modify Lines" command to prefix and append text to lines (Alt+M)
318 | - "Duplicate Selection" command (Alt+D)
319 | - "Invert Case" command (Ctrl+Shift+E)
320 | - "Clear clipboard" command (in the "Edit" menu)
321 | - Force indent and unindent (Ctrl+Tab, Ctrl+Shift+Tab)
322 | - Highlight current line (Ctrl+Shift+I)
323 | - Additional hotkey for "New File": Ctrl+F4
324 | - Mapped Ctrl+Shift+Y/Z to Ctrl+Y/Z
325 | - New hotkey for "Tab Settings" (Ctrl+T)
326 | - Changed hotkey for "Join Lines" (Ctrl+J)
327 | - Rearranged some items in the "View" and "Settings" menus
328 | - "Copy" tool button works as "Copy All" when no text selected
329 | - "Clear" tool button works as "Clear All" when no text selected
330 | - Ctrl+Space: select line if word is already selected
331 | -
,
and other tags are no longer closed automatically
332 | - File, revert now asks if you really want to revert the file
333 | - "Open with..." and "Favorites" directories can be relative
334 | - Directories can be used as favorites (triggers open dialog)
335 | - Filter for open and save dialogs is always set to *.*
336 | - Location of metapath.exe can be specified in ini-file
337 | - "DefaultDirectory" ini-setting (see FAQ on my website)
338 | - "DefaultExtension" ini-setting (see FAQ on my website)
339 | - Select print color mode (defaults to color on white)
340 | - Don't print separator line if header or footer omitted
341 | - Added proper support for multiple monitor systems
342 | - Allow multiple window position settings for different screen sizes
343 | - Option to use a sticky window position
344 | - New command line switches to select syntax schemes: /s, /t, /h, /x
345 | - Added Apache Config Files syntax highlighting
346 | - Added Perl POD verbatim style
347 | - Updated PHP keywords to PHP5
348 | - Updated SQL keywords
349 | - Updated CSS syntax highlighting to CSS2
350 | - Removed NSIS syntax highlighting
351 | - Removed ActionScript syntax highlighting
352 | - Removed "Bookmarks" feature
353 | - Removed "Delete Line Left/Right" and "Transpose Line" commands
354 | - Removed code page trace message
355 | - Fixed several bugs that caused Notepad2 to crash when saving files
356 | - Fixed crash when printing to offline printer
357 | - Fixed bug with transparency level setting
358 |
359 |
360 | New in Version 1.0.12 (released June 25, 2004)
361 |
362 | - Notepad2 source code now released under the GNU GPL
363 | - "Read Only" option handles file attributes
364 | - Enhanced find and replace dialogs with new options
365 | - Optionally auto close HTML/XML tags (Ctrl+Shift+H)
366 | - Improved tabify/untabify selection functions
367 | - New hotkey to select XML scheme (Shift+F11)
368 |
369 |
370 | New in Version 1.0.11 (released May 30, 2004)
371 |
372 | - Simple favorites management based on file shortcuts (Alt+I)
373 | - Optional toolbar buttons for favorites management
374 | - Improved undo / redo handling of auto indent text
375 | - Better cursor behaviour for line editing commands
376 | - Clipboard text is converted according to font character set
377 | - Auto-select ANSI code page option (File, Encoding, Default...)
378 | - Windows system text and background colors used by default
379 | - Enabled some new comment styles for C/C++ related languages
380 |
381 |
382 | New in Version 1.0.10 (released May 21, 2004)
383 |
384 | - Option to select a default syntax scheme (F12)
385 | - Find, replace, upper- and lowercase handle umlauts and accents
386 | - Paste board feature (cmd switch /b) to collect clipboard entries
387 | - Text is copied to clipboard in Unicode format (Windows NT/2k/XP)
388 | - Reload current file without encoding detection (F8)
389 | - Updated CSS properties to version 2.1
390 | - "Reuse Window" disabled by default to allow multiple windows
391 |
392 |
393 | New in Version 1.0.09 (released May 13, 2004)
394 |
395 | - Convert tabs to spaces and vice versa (Ctrl+Shift+S/T)
396 | - Insert time/date (short form/long form) (Ctrl+F5, Ctrl+Shift+F5)
397 | - Insert filename/path and filename (Ctrl+F9, Ctrl+Shift+F9)
398 | - Added missing copy line command (Ctrl+Shift+C)
399 | - Enabled script selection in font dialogs
400 |
401 |
402 | New in Version 1.0.08 (released May 08, 2004)
403 |
404 | - Find and replace dialogs accept Unicode input (Windows NT/2k/XP)
405 | - Warning message for large files (customizable using Notepad2.reg)
406 | - Default file extension is "txt" (customizable using Notepad2.reg)
407 | - New command line parameters: /c, /g, /?
408 | - Fixed writing of hidden and system files (Windows XP/2k)
409 | - Fixed some handling problems with relative pathnames
410 | - Notepad2.txt outlines how to import and export Notepad2 settings
411 |
412 |
413 | New in Version 1.0.07 (released May 03, 2004)
414 |
415 | - Select default encoding for new files
416 | - Select default line endings for new files
417 | - Right clicking moves cursor if no selection
418 | - Zooming with Ctrl+Mousewheel recalculates line number width
419 |
420 |
421 | New in Version 1.0.06 (released April 30, 2004)
422 |
423 | - Word wrap settings, show word wrap symbols (Ctrl+Shift+0)
424 | - Move line up/down (Ctrl+Shift+Up/Down)
425 | - Remove blank lines (Alt+R)
426 | - Bookmarks for file navigation (Ctrl+F2)
427 | - Minimal print header and footer customization
428 | - Remapped some keyboard shortcuts (see Notepad2.txt)
429 | - Added a few comments to Notepad2.txt
430 |
431 |
432 | New in Version 1.0.05 (released April 26, 2004)
433 |
434 | - Support for XML, ActionScript 2.0, Python, NSIS Script
435 | - Fully customizable second default style (Shift+F12)
436 | - Find matching brace (Ctrl+B)
437 | - Select to matching brace (Ctrl+Shift+B)
438 | - Goto column (Ctrl+J)
439 | - Optionally change background color of long lines
440 | - Transparent mode on Windows 2k and above (Alt+U)
441 | - Fixed line endings detection for Unicode files
442 |
443 |
444 | New in Version 1.0.04 (released April 20, 2004)
445 |
446 | - Fixed loading of UTF-8 files with signature
447 |
448 |
449 | New in Version 1.0.03 (released April 19,2004)
450 |
451 | - Toggle word wrap toolbar button
452 | - New block command: strip first character (Alt+Z)
453 | - Strip trailing blanks uses selection, if any
454 |
455 |
456 | New in Version 1.0.02 (released April 17, 2004)
457 |
458 | - Reload current file (F5)
459 | - Revised printing functionality
460 | - Zooming recalculates line number width
461 |
462 |
463 | New in Version 1.0.01 (released April 15, 2004)
464 |
465 | - Initial public release
466 |
467 |
468 | Installation and Uninstallation
469 |
470 | Just put a copy of Notepad2.exe and Notepad2.ini to any directory on
471 | your computer. To uninstall Notepad2, simply delete these two files.
472 | Notepad2 does not create any registry entries on your computer.
473 |
474 |
475 | Keyboard Shortcuts for Notepad2
476 |
477 | File
478 |
479 | Ctrl+N New file.
480 | Ctrl+F4 Close file, identical with Ctrl+N.
481 | Ctrl+O Open file.
482 | F5 Reload file.
483 | F8 Recode file.
484 | Ctrl+Shift+A Recode file as system default ANSI.
485 | Ctrl+Shift+O Recode file as system default OEM.
486 | Shift+F8 Recode 7-bit ASCII file as UTF-8.
487 | Alt+F8 Reload file without file variable parsing.
488 | Ctrl+S Save file.
489 | F6 Save file as.
490 | Ctrl+F6 Save file copy.
491 | Ctrl+P Print file.
492 | Alt+H Open recent file.
493 |
494 | Tools
495 |
496 | Alt+N Open document in new window.
497 | Alt+0 Open new empty window.
498 | Ctrl+M Run metapath file browser plugin.
499 | Ctrl+L Launch document.
500 | Alt+L Open with.
501 | Ctrl+R Run command.
502 |
503 | Favorites
504 |
505 | Alt+I Open favorites.
506 | Alt+K Add to favorites.
507 | Alt+F9 Manage favorites.
508 |
509 | Edit
510 |
511 | Ctrl+Z Undo.
512 | Ctrl+Shift+Z Redo.
513 | Alt+Backspace Undo.
514 | Ctrl+Y Redo.
515 | Ctrl+Shift+Y Undo.
516 | Ctrl+X Cut.
517 | Shift+Del Cut.
518 | Ctrl+C Copy.
519 | Alt+C Copy all.
520 | Ctrl+E Copy add.
521 | Ctrl+V Paste.
522 | Shift+Ins Paste.
523 | Ctrl+K Swap.
524 | Del Clear.
525 | Ctrl+A Select all.
526 | Alt+Shift+Arrows Rectangular selection.
527 | Ctrl+Enter New line with toggled auto indent option.
528 | Ctrl+PgUp/PgDn Goto previous/next block.
529 | Ctrl+Shift+PgUp/PgDn Select to previous/next block.
530 |
531 | Char, Word
532 |
533 | Ctrl+Space Select word (or line).
534 | Ctrl+Backspace Delete word before/left.
535 | Ctrl+Del Delete word after/right.
536 | Ctrl+Tab Insert tabulator.
537 |
538 | Lines
539 |
540 | Ctrl+Shift+Space Select line.
541 | Ctrl+Shift+Up Move line (block) up.
542 | Ctrl+Shift+Down Move line (block) down.
543 | Ctrl+D Duplicate line.
544 | Ctrl+Shift+X Cut line.
545 | Ctrl+Shift+C Copy line.
546 | Ctrl+Shift+D Delete line.
547 | Ctrl+Shift+Backspace Delete line left.
548 | Ctrl+Shift+Del Delete line right.
549 | Ctrl+Shift+W Column wrap.
550 | Ctrl+I Split lines.
551 | Ctrl+J Join lines.
552 | Ctrl+Shift+J Join paragraphs.
553 |
554 | Block
555 |
556 | Tab Indent selected block.
557 | Shift+Tab Unindent selected block.
558 | Alt+Q Enclose selection.
559 | Alt+D Duplicate selection.
560 | Alt+B Pad with spaces.
561 | Alt+Z Strip first character.
562 | Alt+U Strip last character.
563 | Alt+W Strip trailing blanks.
564 | Alt+P Compress whitespace.
565 | Alt+R Remove blank lines.
566 | Alt+M Modify lines.
567 | Alt+O Sort lines.
568 |
569 | Convert
570 |
571 | Ctrl+Shift+U Make uppercase.
572 | Ctrl+U Make lowercase.
573 | Ctrl+Alt+U Invert case.
574 | Ctrl+Alt+I Title case.
575 | Ctrl+Alt+O Sentence case.
576 | Ctrl+Shift+S Convert tabs to spaces.
577 | Ctrl+Shift+T Convert spaces to tabs.
578 | Ctrl+Alt+S Convert indenting tabs to spaces.
579 | Ctrl+Alt+T Convert indenting spaces to tabs.
580 |
581 | Insert
582 |
583 | Alt+X HTML/XML tag.
584 | Ctrl+F8 Encoding identifier.
585 | Ctrl+F5 Time/date (short form).
586 | Ctrl+Shift+F5 Time/date (long form).
587 | Ctrl+F9 Filename.
588 | Ctrl+Shift+F9 Path and filename.
589 |
590 | Special
591 |
592 | Ctrl+Q Block comment (toggle).
593 | Ctrl+Shift+Q Stream comment.
594 | Ctrl+Shift+E URL Encode.
595 | Ctrl+Shift+R URL Decode.
596 | Ctrl+Alt+E Escape C Special Chars.
597 | Ctrl+Alt+U Unescape C Special Chars.
598 | Ctrl+B Find matching brace.
599 | Ctrl+Shift+B Select to matching brace.
600 | Ctrl+1 Enclose within ''.
601 | Ctrl+2 Enclose within "".
602 | Ctrl+3 Enclose within ().
603 | Ctrl+4 Enclose within [].
604 | Ctrl+5 Enclose within {}.
605 | Ctrl+6 Enclose within ``.
606 | Shift+F5 Update timestamps.
607 | Ctrl+Alt++ Increase number.
608 | Ctrl+Alt+- Decrease number.
609 | Ctrl+, Jump to selection start.
610 | Ctrl+. Jump to selection end.
611 |
612 | Find, Replace
613 |
614 | Ctrl+F Find.
615 | Alt+F3 Save find text.
616 | F3 Find next.
617 | Shift+F3 Find previous.
618 | Ctrl+F3 Find next word or selection.
619 | Ctrl+Shift+F3 Find previous word or selection.
620 | F2 Expand selection to next match.
621 | Shift+F2 Expand selection to previous match.
622 | Ctrl+H Replace.
623 | F4 Replace next.
624 | Ctrl+G Jump to line.
625 |
626 | Syntax scheme, Font
627 |
628 | F12 Select syntax scheme.
629 | Shift+F12 Select 2nd default syntax scheme.
630 | Ctrl+F12 Customize syntax schemes.
631 | Alt+F12 Select default font.
632 | F11 Select default text syntax scheme.
633 | Ctrl+F11 Select web source code syntax scheme.
634 | Shift+F11 Select XML document syntax scheme.
635 |
636 | View
637 |
638 | Ctrl+W Toggle word wrap.
639 | Ctrl+Shift+L Show long line marker.
640 | Ctrl+Shift+G Show indentation guides.
641 | Ctrl+Shift+N Show line numbers.
642 | Ctrl+Shift+M Show selection margin.
643 | Ctrl+Shift+8 Show whitespace.
644 | Ctrl+Shift+9 Show line endings.
645 | Ctrl+Shift+0 Show wrap symbols.
646 | Ctrl+Shift+V Toggle visual brace matching.
647 | Ctrl+Shift+I Highlight current line.
648 |
649 | Zoom
650 |
651 | Ctrl++ Zoom in.
652 | Ctrl+- Zoom out.
653 | Ctrl+/ Reset zoom.
654 |
655 | Settings
656 |
657 | Ctrl+T Tab settings.
658 | Alt++ Increase limit for long lines.
659 | Alt+- Decrease limit for long lines.
660 | Ctrl+Shift+H Toggle auto close HTML/XML.
661 | Alt+T Always on top.
662 | Ctrl+0 Transparent mode.
663 | Alt+F5 File change notification settings.
664 | Ctrl+9 Display text excerpt in title.
665 | F7 Save settings now.
666 | Ctrl+F7 Jump to ini-file.
667 |
668 | Misc.
669 |
670 | Shift+F9 Copy pathname to clipboard.
671 | Esc Optionally minimize or exit Notepad2.
672 | Shift+Esc Save file and exit Notepad2.
673 | F1 Display version info.
674 |
675 |
676 | Regular Expression Syntax
677 |
678 | Note: the Scintilla source code editing component supports only a
679 | basic subset of regular expression syntax, and searches are limited
680 | to single lines.
681 |
682 | . Matches any character
683 |
684 | \( This marks the start of a region for tagging a match.
685 |
686 | \) This marks the end of a tagged region.
687 |
688 | \n Where n is 1 through 9 refers to the first through ninth
689 | tagged region when replacing. For example, if the search
690 | string was Fred\([1-9]\)XXX and the replace string was
691 | Sam\1YYY, when applied to Fred2XXX this would generate
692 | Sam2YYY.
693 |
694 | \< This matches the start of a word.
695 |
696 | \> This matches the end of a word.
697 |
698 | \x This allows you to use a character x that would otherwise
699 | have a special meaning. For example, \[ would be interpreted
700 | as [ and not as the start of a character set.
701 |
702 | [...] This indicates a set of characters, for example, [abc] means
703 | any of the characters a, b or c. You can also use ranges, for
704 | example [a-z] for any lower case character.
705 |
706 | [^...] The complement of the characters in the set. For example,
707 | [^A-Za-z] means any character except an alphabetic character.
708 |
709 | ^ This matches the start of a line (unless used inside a set,
710 | see above).
711 |
712 | $ This matches the end of a line.
713 |
714 | * This matches 0 or more times. For example, Sa*m matches Sm,
715 | Sam, Saam, Saaam and so on.
716 |
717 | + This matches 1 or more times. For example, Sa+m matches Sam,
718 | Saam, Saaam and so on.
719 |
720 | \d Any decimal digit.
721 | \D Any character that is not a decimal digit.
722 |
723 | \s Any whitespace character.
724 | \S Any character that is not a whitespace character.
725 |
726 | \w Any "word" character.
727 | \W Any "non-word" character.
728 |
729 | \xHH Character with hex code HH.
730 |
731 | -----> Examples (don't use quotes)
732 | - Quote lines: find "^" replace with "> "
733 | - Unquote lines: find "^> " replace with ""
734 | - Remove line numbers: find "^[0-9]+" replace with ""
735 | - Convert tabs to double spaces: find "\t" replace with " "
736 | - Remove NULL bytes: find "\x00" replace with ""
737 |
738 |
739 | Command Line Switches
740 |
741 | Notepad2.exe [(encoding)] [(line ending mode)] [/e id] [/g ln[,col]]
742 | [/m[-][r|b] text] [/q] [/s ext] [/d] [/h] [/x] [/c]
743 | [/b] [/n|/ns] [/r|/rs]
744 | [/p x,y,cx,cy[,max]|/p0|/ps|/pf,l,t,r,b,m]
745 | [/t title] [/i] [/f ini|/f0] [/u] [/z ...] [/?]
746 | [+|-] [file] ...
747 |
748 | file File to open, can be a relative pathname, or a shell link.
749 | Must be the last argument, no quoted spaces by default.
750 | + Accept multiple file arguments (with quoted spaces).
751 | - Accept single file argument (without quoted spaces).
752 | ... Desired file encoding (can be one of /ansi, /unicode,
753 | /unicodebe, /utf8 or /utf8sig).
754 | ... Desired line ending mode (either /crlf, /lf, or /cr).
755 | /e Specify file source encoding.
756 | /g Jump to specified position, /g -1 means end of file.
757 | /m Match specified text (/m- last, /mr regex, /mb backslash).
758 | /q Force creation of new files without prompt.
759 | /s Select syntax scheme associated with specified extension.
760 | /d Select default text scheme.
761 | /h Select Web Source Code scheme.
762 | /x Select XML Document scheme.
763 | /c Open a new Notepad2 window and paste the clipboard contents.
764 | /b Open a new Notepad2 paste board to collect clipboard entries.
765 | /n Always open a new Notepad2 window (/ns single file instance).
766 | /r Reuse Notepad2 window (/rs single file instance).
767 | /p Set window position to x,y with size cx,cy, optional max set
768 | to nonzero to zoom; /p0 system, /ps internal defaults;
769 | /p(f)ull,(l)eft,(t)op,(r)ight,(b)ottom,(m)argin.
770 | /t Set window title.
771 | /i Start as tray icon.
772 | /f Specify ini-file; /f0 use no ini-file (don't save settings).
773 | /u Launch with elevated privileges.
774 | /z Skip next (usable for registry-based Notepad replacement).
775 | /? Display a brief summary about command line parameters.
776 |
777 |
778 | Source Code
779 |
780 | Notepad2 is based on the Scintilla source code editing component:
781 | http://www.scintilla.org
782 |
783 | The full Notepad2 source code can be found at:
784 | http://www.flos-freeware.ch
785 |
786 |
787 | More Information and Resources
788 |
789 | For more information on Notepad2 features, how to replace Windows
790 | Notepad, and answers to the most frequently asked questions (FAQ),
791 | please visit the Notepad2 website:
792 | http://www.flos-freeware.ch
793 |
794 |
795 | Feature Requests
796 |
797 | Thank you very much for the overwhelming feedback about Notepad2!
798 | Feature requests are always welcome, but please keep in mind that
799 | Notepad2 has been designed as a compact Notepad replacement.
800 |
801 |
802 | Credits and Special Thanks
803 |
804 | Here I would like to say "THANK YOU" to the developers of the great
805 | Scintilla source code editing component [1], which is the core of
806 | Notepad2. Without Scintilla, the rich features found in Notepad2
807 | wouldn't have been possible!
808 |
809 | [1] http://www.scintilla.org
810 |
811 | Many thanks to everybody for sending me bug reports and useful hints.
812 | A special thank goes to Roland Weigelt [2] for his helpful thoughts
813 | and comments about Notepad2 features and usability in early develop-
814 | ment stages. I'd also like to express my thanks to Timo Kunze [3],
815 | to Kai Liu [4] and to Moritz Kroll for sending detailed bug reports
816 | and ready-to-use patches.
817 |
818 | [2] http://www.roland-weigelt.de
819 | [3] http://www.TimoSoft-Software.de
820 | [4] http://code.kliu.org/misc/notepad2/
821 |
822 |
823 | Copyright
824 |
825 | Notepad2 is FREE SOFTWARE and may be used and distributed freely.
826 | Please do not charge any distribution or download fees for this
827 | program, except for the cost of the distribution medium. The use of
828 | this software is AT YOUR OWN RISK. See License.txt for full details.
829 |
830 | If you have comments or questions, please drop me a note:
831 | florian.balmer@gmail.com
832 |
833 | (c) Florian Balmer 2004-2010
834 |
835 | ###
836 |
--------------------------------------------------------------------------------
/Readme.flo.txt:
--------------------------------------------------------------------------------
1 |
2 | =======================================================================
3 | = =
4 | = =
5 | = Notepad2 - light-weight Scintilla-based text editor for Windows =
6 | = =
7 | = =
8 | = Notepad2 4.1.24 =
9 | = (c) Florian Balmer 2004-2010 =
10 | = http://www.flos-freeware.ch =
11 | = =
12 | = =
13 | =======================================================================
14 |
15 |
16 | The Notepad2 Source Code
17 |
18 | This package contains the full source code of Notepad2 4.1.24 for
19 | Windows. Project files for Visual C++ 7.0 are included. Chances are
20 | that Notepad2 can be rebuilt with other development tools, including
21 | the free Visual C++ Express Edition, but I haven't tested this.
22 |
23 |
24 | Rebuilding from the Source Code
25 |
26 | To be able to rebuild Notepad2, the source code of the Scintilla
27 | editing component [1] has to be unzipped to the "Scintilla"
28 | subdirectory of the Notepad2 source code directory.
29 |
30 | [1] http://www.scintilla.org
31 |
32 | Notepad2 4.1.24 has been created with Scintilla 2.03. The following
33 | modification to the Scintilla source code is necessary:
34 |
35 | Scintilla/src/KeyWords.cxx:
36 |
37 | #define LINK_LEXER(lexer) extern LexerModule lexer; ...
38 |
39 | must be replaced with:
40 |
41 | #define LINK_LEXER(lexer) void(0)
42 |
43 |
44 | Creating a Compact Executable Program File
45 |
46 | Linking to the system CRT slightly improves disk footprint, memory
47 | usage and startup because the pages for the system CRT are already
48 | loaded and shared in memory. To achieve this, the release version of
49 | Notepad2.exe is built using the Windows Driver Kit (WDK) 7.1.0 tools,
50 | available as a free download from Microsoft. The appropriate build
51 | scripts can be found in the "wdkbuild" subdirectory. Set %WDKBASEDIR%
52 | to the directory where the WDK tools are located on your system.
53 |
54 |
55 | How to add or modify Syntax Schemes
56 |
57 | The Scintilla documentation has an overview of syntax highlighting,
58 | and how to write your own lexing module, in case the language you
59 | would like to add is not currently supported by Scintilla.
60 |
61 | Add your own lexer data structs to the global pLexArray (Styles.c),
62 | then adjust NUMLEXERS (Styles.h) to the new total number of syntax
63 | schemes. The style definitions can be found in SciLexer.h of the
64 | Scintilla source code. Include the Lex*.cxx file from Scintilla
65 | required for your language into your project.
66 |
67 |
68 | Copyright
69 |
70 | See License.txt for details about distribution and modification.
71 |
72 | If you have any comments or questions, please drop me a note:
73 | florian.balmer@gmail.com
74 |
75 | (c) Florian Balmer 2004-2010
76 | http://www.flos-freeware.ch
77 |
78 | ###
79 |
--------------------------------------------------------------------------------
/inc/winres.h:
--------------------------------------------------------------------------------
1 | // Notepad2 winres.h required definitions
2 | #include
3 |
4 |
5 | #ifdef IDC_STATIC
6 | #undef IDC_STATIC
7 | #endif
8 | #define IDC_STATIC (-1)
9 |
10 |
--------------------------------------------------------------------------------
/nsis/notepad2.nsi:
--------------------------------------------------------------------------------
1 | # notepad2.nsi
2 | #
3 | # Notepad2 Nullsoft Installer Script
4 | # Author: Dan Savilonis
5 |
6 | !include WinVer.nsh
7 |
8 | Name "Notepad2"
9 | Caption "Notepad2 Setup"
10 | Icon "..\res\Notepad2.ico"
11 | UninstallIcon "..\res\Notepad2.ico"
12 | OutFile "notepad2-install.exe"
13 |
14 | XPStyle on
15 | SetCompressor /SOLID /FINAL lzma
16 |
17 | InstallDir "$PROGRAMFILES\Notepad2"
18 | InstallDirRegKey HKLM "Software\Notepad2" "Install_Dir"
19 |
20 | LicenseData "..\License.txt"
21 |
22 | RequestExecutionLevel admin
23 |
24 | ;--------------------------------
25 |
26 | Page license
27 | Page components
28 | Page directory
29 | Page instfiles
30 |
31 | UninstPage uninstConfirm
32 | UninstPage instfiles
33 |
34 | ;--------------------------------
35 |
36 | !ifndef NOINSTTYPES
37 | InstType "Typical"
38 | InstType "Minimal"
39 | !endif
40 |
41 | ;--------------------------------
42 |
43 |
44 | Section "Notepad2"
45 |
46 | SectionIn 1 2 RO
47 |
48 | SetOutPath $INSTDIR
49 |
50 | File ..\bin\notepad2.exe
51 |
52 | WriteRegStr HKLM SOFTWARE\Notepad2 "Install_Dir" "$INSTDIR"
53 |
54 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad2" "DisplayName" "Notepad2"
55 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad2" "UninstallString" '"$INSTDIR\uninstall.exe"'
56 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad2" "NoModify" 1
57 | WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad2" "NoRepair" 1
58 | WriteUninstaller "uninstall.exe"
59 |
60 | # Windows 7 Jumplists support
61 | ${If} ${AtLeastWin7}
62 | WriteRegStr HKCR "*\OpenWithList\notepad2.exe" "" ""
63 | WriteRegStr HKCR "Applications\notepad2.exe" "AppUserModelID" "Notepad2"
64 | WriteRegStr HKCR "Applications\notepad2.exe\shell\open\command" "" '"$INSTDIR\notepad2.exe" %1'
65 | ${EndIf}
66 |
67 | SectionEnd
68 |
69 | Section "Replace Notepad"
70 |
71 | SectionIn 1
72 |
73 | WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" "Debugger" "$INSTDIR\notepad2.exe /z"
74 |
75 | SectionEnd
76 |
77 | Section "Start Menu"
78 |
79 | SectionIn 1 2
80 |
81 | CreateDirectory "$SMPROGRAMS\Notepad2"
82 | CreateShortCut "$SMPROGRAMS\Notepad2\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
83 | CreateShortCut "$SMPROGRAMS\Notepad2\Notepad2.lnk" "$INSTDIR\notepad2.exe" "" "$INSTDIR\notepad2.exe" 0
84 |
85 | SectionEnd
86 |
87 |
88 | ;--------------------------------
89 |
90 | ; Uninstaller
91 |
92 | Section "Uninstall"
93 |
94 | ; Remove registry keys
95 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad2"
96 | DeleteRegKey HKLM "SOFTWARE\Notepad2"
97 |
98 | DeleteRegKey HKCR "*\OpenWithList\notepad2.exe"
99 | DeleteRegKey HKCR "Applications\notepad2.exe"
100 | DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe"
101 |
102 | ; Remove files and uninstaller
103 | Delete $INSTDIR\notepad2.exe
104 | Delete $INSTDIR\uninstall.exe
105 |
106 | ; Remove shortcuts, if any
107 | Delete "$SMPROGRAMS\Notepad2\*.*"
108 |
109 | ; Remove directories used
110 | RMDir "$SMPROGRAMS\Notepad2"
111 | RMDir "$INSTDIR"
112 |
113 | SectionEnd
114 |
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | Notepad2 Unified Edition
2 | ================================================================================
3 |
4 | Dan Savilonis
5 | http://github.com/djs/notepad2
6 |
7 | Notepad2 originally (c) Florian Balmer 2004-2010 (www.flos-freeware.ch)
8 | Code folding and other modifications (c) Kai Liu 2009 (code.kliu.org/misc/notepad2/)
9 |
10 |
11 |
12 | Building
13 | ================================================================================
14 |
15 | Requirements
16 | --------------------------------------------------------------------------------
17 |
18 | * Microsoft Windows SDK
19 | * NSIS 2.46
20 |
21 | Instructions
22 | --------------------------------------------------------------------------------
23 |
24 | To build Notepad2, you must first build the modified Scintilla library:
25 |
26 | $ cd scintilla
27 | $ nmake
28 |
29 | Then, build Notepad2:
30 |
31 | $ cd ..
32 | $ nmake
33 |
34 | To build the installer, run:
35 |
36 | $ makensis nsis/notepad2.nsi
37 |
38 | Notepad2 should build as a 32-bit or 64-bit executable, depending on the SDK
39 | build environment used.
40 |
41 |
--------------------------------------------------------------------------------
/res/Copy.cur:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Copy.cur
--------------------------------------------------------------------------------
/res/Encoding.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Encoding.bmp
--------------------------------------------------------------------------------
/res/Next.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Next.bmp
--------------------------------------------------------------------------------
/res/Notepad2.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Notepad2.ico
--------------------------------------------------------------------------------
/res/Open.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Open.bmp
--------------------------------------------------------------------------------
/res/Pick.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Pick.bmp
--------------------------------------------------------------------------------
/res/Prev.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Prev.bmp
--------------------------------------------------------------------------------
/res/Run.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Run.ico
--------------------------------------------------------------------------------
/res/Styles.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Styles.ico
--------------------------------------------------------------------------------
/res/Toolbar.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/res/Toolbar.bmp
--------------------------------------------------------------------------------
/src/Dialogs.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Dialogs.h
7 | * Definitions for Notepad2 dialog boxes
8 | *
9 | * See Readme.txt for more information about this source code.
10 | * Please send me your comments to this work.
11 | *
12 | * See License.txt for details about distribution and modification.
13 | *
14 | * (c) Florian Balmer 1996-2010
15 | * florian.balmer@gmail.com
16 | * http://www.flos-freeware.ch
17 | *
18 | *
19 | ******************************************************************************/
20 |
21 |
22 | #define MBINFO 0
23 | #define MBWARN 1
24 | #define MBYESNO 2
25 | #define MBYESNOWARN 3
26 | #define MBYESNOCANCEL 4
27 | #define MBOKCANCEL 8
28 |
29 | int MsgBox(int,UINT,...);
30 | void DisplayCmdLineHelp();
31 | BOOL GetDirectory(HWND,int,LPWSTR,LPCWSTR,BOOL);
32 | BOOL CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
33 | void RunDlg(HWND,LPCWSTR);
34 | BOOL OpenWithDlg(HWND,LPCWSTR);
35 | BOOL FavoritesDlg(HWND,LPWSTR);
36 | BOOL AddToFavDlg(HWND,LPCWSTR,LPCWSTR);
37 | BOOL FileMRUDlg(HWND,LPWSTR);
38 | BOOL ChangeNotifyDlg(HWND);
39 | BOOL ColumnWrapDlg(HWND,UINT,int *);
40 | BOOL WordWrapSettingsDlg(HWND,UINT,int *);
41 | BOOL LongLineSettingsDlg(HWND,UINT,int *);
42 | BOOL TabSettingsDlg(HWND,UINT,int *);
43 | BOOL SelectDefEncodingDlg(HWND,int *);
44 | BOOL SelectEncodingDlg(HWND,int *);
45 | BOOL RecodeDlg(HWND,int *);
46 | BOOL SelectDefLineEndingDlg(HWND,int *);
47 | int InfoBox(int,LPCWSTR,int,...);
48 |
49 |
50 | // End of Dialogs.h
51 |
--------------------------------------------------------------------------------
/src/Dlapi.c:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Dlapi.c
7 | * Directory Listing APIs used in Notepad2
8 | *
9 | * See Readme.txt for more information about this source code.
10 | * Please send me your comments to this work.
11 | *
12 | * See License.txt for details about distribution and modification.
13 | *
14 | * (c) Florian Balmer 1996-2010
15 | * florian.balmer@gmail.com
16 | * http://www.flos-freeware.ch
17 | *
18 | *
19 | ******************************************************************************/
20 | #define _WIN32_WINNT 0x501
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include "dlapi.h"
27 |
28 |
29 |
30 | //==== Global LPMALLOC instance ===============================================
31 | extern LPMALLOC g_lpMalloc;
32 |
33 |
34 |
35 | //==== DirList ================================================================
36 |
37 | //==== DLDATA Structure =======================================================
38 |
39 | typedef struct tagDLDATA // dl
40 | {
41 |
42 | HWND hwnd; // HWND of ListView Control
43 | UINT cbidl; // Size of pidl
44 | LPITEMIDLIST pidl; // Directory Id
45 | LPSHELLFOLDER lpsf; // IShellFolder Interface to pidl
46 | WCHAR szPath[MAX_PATH]; // Pathname to Directory Id
47 | int iDefIconFolder; // Default Folder Icon
48 | int iDefIconFile; // Default File Icon
49 | BOOL bNoFadeHidden; // Flag passed from GetDispInfo()
50 | HANDLE hExitThread; // Flag is set when Icon Thread should terminate
51 | HANDLE hTerminatedThread; // Flag is set when Icon Thread has terminated
52 |
53 | } DLDATA, *LPDLDATA;
54 |
55 |
56 | //==== Property Name ==========================================================
57 | static const WCHAR *pDirListProp = L"DirListData";
58 |
59 |
60 |
61 | //=============================================================================
62 | //
63 | // DirList_Init()
64 | //
65 | // Initializes the DLDATA structure and sets up the listview control
66 | //
67 | BOOL DirList_Init(HWND hwnd,LPCWSTR pszHeader)
68 | {
69 |
70 | HIMAGELIST hil;
71 | SHFILEINFO shfi;
72 | LV_COLUMN lvc;
73 |
74 | // Allocate DirListData Property
75 | LPDLDATA lpdl = (LPVOID)GlobalAlloc(GPTR,sizeof(DLDATA));
76 | SetProp(hwnd,pDirListProp,(HANDLE)lpdl);
77 |
78 | // Setup dl
79 | lpdl->hwnd = hwnd;
80 | lpdl->cbidl = 0;
81 | lpdl->pidl = NULL;
82 | lpdl->lpsf = NULL;
83 | lstrcpy(lpdl->szPath,L"");
84 |
85 | // Add Imagelists
86 | hil = (HIMAGELIST)SHGetFileInfo(L"C:\\",0,&shfi,sizeof(SHFILEINFO),
87 | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
88 |
89 | ListView_SetImageList(hwnd,hil,LVSIL_SMALL);
90 |
91 | hil = (HIMAGELIST)SHGetFileInfo(L"C:\\",0,&shfi,sizeof(SHFILEINFO),
92 | SHGFI_LARGEICON | SHGFI_SYSICONINDEX);
93 |
94 | ListView_SetImageList(hwnd,hil,LVSIL_NORMAL);
95 |
96 | // Initialize default icons - done in DirList_Fill()
97 | //SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_DIRECTORY,&shfi,sizeof(SHFILEINFO),
98 | // SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
99 | //lpdl->iDefIconFolder = shfi.iIcon;
100 |
101 | //SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_NORMAL,&shfi,sizeof(SHFILEINFO),
102 | // SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
103 | //lpdl->iDefIconFile = shfi.iIcon;
104 |
105 | lpdl->iDefIconFolder = 0;
106 | lpdl->iDefIconFile = 0;
107 |
108 | // Icon thread control
109 | lpdl->hExitThread = CreateEvent(NULL,TRUE,FALSE,NULL);
110 | lpdl->hTerminatedThread = CreateEvent(NULL,TRUE,TRUE,NULL);
111 |
112 | lvc;
113 | pszHeader;
114 |
115 | return TRUE;
116 |
117 | }
118 |
119 |
120 | //=============================================================================
121 | //
122 | // DirList_Destroy()
123 | //
124 | // Free memory used by dl structure
125 | //
126 | BOOL DirList_Destroy(HWND hwnd)
127 | {
128 |
129 | //LPMALLOC lpMalloc;
130 |
131 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
132 |
133 | // Release multithreading objects
134 | DirList_TerminateIconThread(hwnd);
135 | CloseHandle(lpdl->hExitThread);
136 | CloseHandle(lpdl->hTerminatedThread);
137 |
138 | //if (NOERROR == SHGetMalloc(&lpMalloc))
139 | //{
140 |
141 | if (lpdl->pidl)
142 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdl->pidl);
143 |
144 | //lpMalloc->lpVtbl->Release(lpMalloc);
145 |
146 | if (lpdl->lpsf)
147 | lpdl->lpsf->lpVtbl->Release(lpdl->lpsf);
148 |
149 | //}
150 |
151 | // Free DirListData Property
152 | RemoveProp(hwnd,pDirListProp);
153 | GlobalFree(lpdl);
154 |
155 | return FALSE;
156 |
157 | }
158 |
159 |
160 | //=============================================================================
161 | //
162 | // DirList_StartIconThread()
163 | //
164 | // Start thread to extract file icons in the background
165 | //
166 | BOOL DirList_StartIconThread(HWND hwnd)
167 | {
168 |
169 | DWORD dwtid;
170 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
171 |
172 | DirList_TerminateIconThread(hwnd);
173 |
174 | ResetEvent(lpdl->hExitThread);
175 | //ResetEvent(lpdl->hTerminatedThread);
176 |
177 | CreateThread(NULL,0,DirList_IconThread,(LPVOID)lpdl,0,&dwtid);
178 |
179 | return TRUE;
180 |
181 | }
182 |
183 |
184 | //=============================================================================
185 | //
186 | // DirList_TerminateIconThread()
187 | //
188 | // Terminate Icon Thread and reset multithreading control structures
189 | //
190 | BOOL DirList_TerminateIconThread(HWND hwnd)
191 | {
192 |
193 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
194 |
195 | SetEvent(lpdl->hExitThread);
196 |
197 | //WaitForSingleObject(lpdl->hTerminatedThread,INFINITE);
198 | while (WaitForSingleObject(lpdl->hTerminatedThread,0) != WAIT_OBJECT_0)
199 | {
200 | MSG msg;
201 | if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) {
202 | TranslateMessage(&msg);
203 | DispatchMessage(&msg);
204 | }
205 | }
206 |
207 | ResetEvent(lpdl->hExitThread);
208 | SetEvent(lpdl->hTerminatedThread);
209 |
210 | return TRUE;
211 |
212 | }
213 |
214 |
215 | //=============================================================================
216 | //
217 | // DirList_Fill()
218 | //
219 | // Snapshots a directory and displays the items in the listview control
220 | //
221 | int DirList_Fill(HWND hwnd,LPCWSTR lpszDir,DWORD grfFlags,LPCWSTR lpszFileSpec,
222 | BOOL bExcludeFilter,BOOL bNoFadeHidden,
223 | int iSortFlags,BOOL fSortRev)
224 | {
225 |
226 | WCHAR wszDir[MAX_PATH];
227 |
228 | //LPMALLOC lpMalloc = NULL;
229 |
230 | LPSHELLFOLDER lpsfDesktop = NULL;
231 | LPSHELLFOLDER lpsf = NULL;
232 |
233 | LPITEMIDLIST pidl = NULL;
234 | LPITEMIDLIST pidlEntry = NULL;
235 |
236 | LPENUMIDLIST lpe = NULL;
237 |
238 | LV_ITEM lvi;
239 | LPLV_ITEMDATA lplvid;
240 |
241 | ULONG chParsed = 0;
242 | ULONG dwAttributes = 0;
243 |
244 | DL_FILTER dlf;
245 | SHFILEINFO shfi;
246 |
247 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
248 |
249 | // Initialize default icons
250 | SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_DIRECTORY,&shfi,sizeof(SHFILEINFO),
251 | SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
252 | lpdl->iDefIconFolder = shfi.iIcon;
253 |
254 | SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_NORMAL,&shfi,sizeof(SHFILEINFO),
255 | SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
256 | lpdl->iDefIconFile = shfi.iIcon;
257 |
258 | // First of all terminate running icon thread
259 | DirList_TerminateIconThread(hwnd);
260 |
261 | // A Directory is strongly required
262 | if (!lpszDir || !*lpszDir)
263 | return(-1);
264 |
265 | lstrcpy(lpdl->szPath,lpszDir);
266 |
267 | // Init ListView
268 | SendMessage(hwnd,WM_SETREDRAW,0,0);
269 | ListView_DeleteAllItems(hwnd);
270 |
271 | // Init Filter
272 | DirList_CreateFilter(&dlf,lpszFileSpec,bExcludeFilter);
273 |
274 | // Init lvi
275 | lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
276 | lvi.iItem = 0;
277 | lvi.iSubItem = 0;
278 | lvi.pszText = LPSTR_TEXTCALLBACK;
279 | lvi.cchTextMax = MAX_PATH;
280 | lvi.iImage = I_IMAGECALLBACK;
281 |
282 | // Convert Directory to a UNICODE string
283 | /*MultiByteToWideChar(CP_ACP,
284 | MB_PRECOMPOSED,
285 | lpszDir,
286 | -1,
287 | wszDir,
288 | MAX_PATH);*/
289 | lstrcpy(wszDir,lpszDir);
290 |
291 |
292 | // Get Shell's IMalloc Interface
293 | //if (NOERROR == SHGetMalloc(&lpMalloc))
294 | //{
295 |
296 | // Get Desktop Folder
297 | if (NOERROR == SHGetDesktopFolder(&lpsfDesktop))
298 | {
299 |
300 | // Convert wszDir into a pidl
301 | if (NOERROR == lpsfDesktop->lpVtbl->ParseDisplayName(
302 | lpsfDesktop,
303 | hwnd,
304 | NULL,
305 | wszDir,
306 | &chParsed,
307 | &pidl,
308 | &dwAttributes))
309 |
310 | {
311 |
312 | // Bind pidl to IShellFolder
313 | if (NOERROR == lpsfDesktop->lpVtbl->BindToObject(
314 | lpsfDesktop,
315 | pidl,
316 | NULL,
317 | &IID_IShellFolder,
318 | &lpsf))
319 |
320 | {
321 |
322 | // Create an Enumeration object for lpsf
323 | if (NOERROR == lpsf->lpVtbl->EnumObjects(
324 | lpsf,
325 | hwnd,
326 | grfFlags,
327 | &lpe))
328 |
329 | {
330 |
331 | // Enumerate the contents of lpsf
332 | while (NOERROR == lpe->lpVtbl->Next(
333 | lpe,
334 | 1,
335 | &pidlEntry,
336 | NULL))
337 |
338 | {
339 |
340 | // Add found item to the List
341 | // Check if it's part of the Filesystem
342 | dwAttributes = SFGAO_FILESYSTEM | SFGAO_FOLDER;
343 |
344 | lpsf->lpVtbl->GetAttributesOf(
345 | lpsf,
346 | 1,
347 | &pidlEntry,
348 | &dwAttributes);
349 |
350 | if (dwAttributes & SFGAO_FILESYSTEM)
351 | {
352 |
353 | // Check if item matches specified filter
354 | if (DirList_MatchFilter(lpsf,pidlEntry,&dlf))
355 | {
356 |
357 | lplvid = g_lpMalloc->lpVtbl->Alloc(
358 | g_lpMalloc,
359 | sizeof(LV_ITEMDATA));
360 |
361 | lplvid->pidl = pidlEntry;
362 | lplvid->lpsf = lpsf;
363 |
364 | lpsf->lpVtbl->AddRef(lpsf);
365 |
366 | lvi.lParam = (LPARAM)lplvid;
367 |
368 | // Setup default Icon - Folder or File
369 | lvi.iImage = (dwAttributes & SFGAO_FOLDER) ?
370 | lpdl->iDefIconFolder : lpdl->iDefIconFile;
371 |
372 | ListView_InsertItem(hwnd,&lvi);
373 |
374 | lvi.iItem++;
375 |
376 | }
377 |
378 | }
379 |
380 | //lpMalloc->lpVtbl->Free(lpMalloc,pidlEntry);
381 |
382 | } // IEnumIDList::Next()
383 |
384 | lpe->lpVtbl->Release(lpe);
385 |
386 | } // IShellFolder::EnumObjects()
387 |
388 | } // IShellFolder::BindToObject()
389 |
390 | } // IShellFolder::ParseDisplayName()
391 |
392 | lpsfDesktop->lpVtbl->Release(lpsfDesktop);
393 |
394 | } // SHGetDesktopFolder()
395 |
396 | if (lpdl->pidl)
397 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdl->pidl);
398 |
399 | if (lpdl->lpsf && lpdl->lpsf->lpVtbl)
400 | lpdl->lpsf->lpVtbl->Release(lpdl->lpsf);
401 |
402 | //lpMalloc->lpVtbl->Release(lpMalloc);
403 |
404 | //} // SHGetMalloc()
405 |
406 | // Set lpdl
407 | lpdl->cbidl = IL_GetSize(pidl);
408 | lpdl->pidl = pidl;
409 | lpdl->lpsf = lpsf;
410 | lpdl->bNoFadeHidden = bNoFadeHidden;
411 |
412 | // Set column width to fit window
413 | ListView_SetColumnWidth(hwnd,0,LVSCW_AUTOSIZE_USEHEADER);
414 |
415 | // Sort before display is updated
416 | DirList_Sort(hwnd,iSortFlags,fSortRev);
417 |
418 | // Redraw Listview
419 | SendMessage(hwnd,WM_SETREDRAW,1,0);
420 |
421 | // Return number of items in the control
422 | return (ListView_GetItemCount(hwnd));
423 |
424 | }
425 |
426 |
427 | //=============================================================================
428 | //
429 | // DirList_IconThread()
430 | //
431 | // Thread to extract file icons in the background
432 | //
433 | DWORD WINAPI DirList_IconThread(LPVOID lpParam)
434 | {
435 |
436 | HWND hwnd;
437 |
438 | LPDLDATA lpdl;
439 | LV_ITEM lvi;
440 | LPLV_ITEMDATA lplvid;
441 |
442 | LPMALLOC lpMalloc;
443 | IShellIcon* lpshi;
444 |
445 | int iItem = 0;
446 | int iMaxItem;
447 |
448 | lpdl = (LPDLDATA)lpParam;
449 | ResetEvent(lpdl->hTerminatedThread);
450 |
451 | // Exit immediately if DirList_Fill() hasn't been called
452 | if (!lpdl->lpsf) {
453 | SetEvent(lpdl->hTerminatedThread);
454 | ExitThread(0);
455 | return(0);
456 | }
457 |
458 | hwnd = lpdl->hwnd;
459 | iMaxItem = ListView_GetItemCount(hwnd);
460 |
461 | CoInitialize(NULL);
462 | SHGetMalloc(&lpMalloc);
463 |
464 | // Get IShellIcon
465 | lpdl->lpsf->lpVtbl->QueryInterface(lpdl->lpsf,&IID_IShellIcon,&lpshi);
466 |
467 | while (iItem < iMaxItem && WaitForSingleObject(lpdl->hExitThread,0) != WAIT_OBJECT_0) {
468 |
469 | lvi.iItem = iItem;
470 | lvi.mask = LVIF_PARAM;
471 | if (ListView_GetItem(hwnd,&lvi)) {
472 |
473 | SHFILEINFO shfi;
474 | LPITEMIDLIST pidl;
475 | DWORD dwAttributes = SFGAO_LINK | SFGAO_SHARE;
476 |
477 | lplvid = (LPLV_ITEMDATA)lvi.lParam;
478 |
479 | lvi.mask = LVIF_IMAGE;
480 |
481 | if (!lpshi || NOERROR != lpshi->lpVtbl->GetIconOf(lpshi,lplvid->pidl,GIL_FORSHELL,&lvi.iImage))
482 | {
483 | pidl = IL_Create(lpMalloc,lpdl->pidl,lpdl->cbidl,lplvid->pidl,0);
484 | SHGetFileInfo((LPCWSTR)pidl,0,&shfi,sizeof(SHFILEINFO),SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
485 | lpMalloc->lpVtbl->Free(lpMalloc,pidl);
486 | lvi.iImage = shfi.iIcon;
487 | }
488 |
489 | // It proved necessary to reset the state bits...
490 | lvi.stateMask = 0;
491 | lvi.state = 0;
492 |
493 | // Link and Share Overlay
494 | lplvid->lpsf->lpVtbl->GetAttributesOf(
495 | lplvid->lpsf,
496 | 1,&lplvid->pidl,
497 | &dwAttributes);
498 |
499 | if (dwAttributes & SFGAO_LINK)
500 | {
501 | lvi.mask |= LVIF_STATE;
502 | lvi.stateMask |= LVIS_OVERLAYMASK;
503 | lvi.state |= INDEXTOOVERLAYMASK(2);
504 | }
505 |
506 | if (dwAttributes & SFGAO_SHARE)
507 | {
508 | lvi.mask |= LVIF_STATE;
509 | lvi.stateMask |= LVIS_OVERLAYMASK;
510 | lvi.state |= INDEXTOOVERLAYMASK(1);
511 | }
512 |
513 | // Fade hidden/system files
514 | if (!lpdl->bNoFadeHidden)
515 | {
516 | WIN32_FIND_DATA fd;
517 | if (NOERROR == SHGetDataFromIDList(lplvid->lpsf,lplvid->pidl,
518 | SHGDFIL_FINDDATA,&fd,sizeof(WIN32_FIND_DATA)))
519 | {
520 | if ((fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ||
521 | (fd.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM))
522 | {
523 | lvi.mask |= LVIF_STATE;
524 | lvi.stateMask |= LVIS_CUT;
525 | lvi.state |= LVIS_CUT;
526 | }
527 | }
528 | }
529 | lvi.iSubItem = 0;
530 | ListView_SetItem(hwnd,&lvi);
531 | }
532 | iItem++;
533 | }
534 |
535 | if (lpshi)
536 | lpshi->lpVtbl->Release(lpshi);
537 |
538 | lpMalloc->lpVtbl->Release(lpMalloc);
539 | CoUninitialize();
540 |
541 | SetEvent(lpdl->hTerminatedThread);
542 | ExitThread(0);
543 | return(0);
544 |
545 | }
546 |
547 |
548 | //=============================================================================
549 | //
550 | // DirList_GetDispInfo()
551 | //
552 | // Must be called in response to a WM_NOTIFY/LVN_GETDISPINFO message from
553 | // the listview control
554 | //
555 | BOOL DirList_GetDispInfo(HWND hwnd,LPARAM lParam,BOOL bNoFadeHidden)
556 | {
557 |
558 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
559 |
560 | LV_DISPINFO *lpdi = (LPVOID)lParam;
561 |
562 | LPLV_ITEMDATA lplvid = (LPLV_ITEMDATA)lpdi->item.lParam;
563 |
564 | // SubItem 0 is handled only
565 | if (lpdi->item.iSubItem != 0)
566 | return FALSE;
567 |
568 | // Text
569 | if (lpdi->item.mask & LVIF_TEXT)
570 | IL_GetDisplayName(lplvid->lpsf,lplvid->pidl,SHGDN_INFOLDER,
571 | lpdi->item.pszText,lpdi->item.cchTextMax);
572 |
573 | // Image
574 | //if (lpdi->item.mask & LVIF_IMAGE)
575 | //{
576 |
577 | // //LPMALLOC lpMalloc;
578 | // SHFILEINFO shfi;
579 | // LPITEMIDLIST pidl;
580 | // DWORD dwAttributes = SFGAO_LINK | SFGAO_SHARE;
581 |
582 | // //if (NOERROR == SHGetMalloc(&lpMalloc))
583 | // //{
584 |
585 | // // Generate Full Qualified pidl
586 | // pidl = IL_Create(g_lpMalloc,lpdl->pidl,lpdl->cbidl,lplvid->pidl,0);
587 |
588 | // SHGetFileInfo((LPCWSTR)pidl,0,&shfi,sizeof(SHFILEINFO),SHGFI_PIDL | SHGFI_SYSICONINDEX);
589 |
590 | // lpdi->item.iImage = shfi.iIcon;
591 |
592 | // g_lpMalloc->lpVtbl->Free(g_lpMalloc,pidl);
593 | // //lpMalloc->lpVtbl->Release(lpMalloc);
594 |
595 | // //}
596 |
597 | // // It proved necessary to reset the state bits...
598 | // lpdi->item.stateMask = 0;
599 | // lpdi->item.state = 0;
600 |
601 | // // Link and Share Overlay
602 | // lplvid->lpsf->lpVtbl->GetAttributesOf(
603 | // lplvid->lpsf,
604 | // 1,&lplvid->pidl,
605 | // &dwAttributes);
606 |
607 | // if (dwAttributes & SFGAO_LINK)
608 | // {
609 | // lpdi->item.mask |= LVIF_STATE;
610 | // lpdi->item.stateMask |= LVIS_OVERLAYMASK;
611 | // lpdi->item.state |= INDEXTOOVERLAYMASK(2);
612 | // }
613 |
614 | // if (dwAttributes & SFGAO_SHARE)
615 | // {
616 | // lpdi->item.mask |= LVIF_STATE;
617 | // lpdi->item.stateMask |= LVIS_OVERLAYMASK;
618 | // lpdi->item.state |= INDEXTOOVERLAYMASK(1);
619 | // }
620 |
621 | // // Fade hidden/system files
622 | // if (!bNoFadeHidden)
623 | // {
624 | // WIN32_FIND_DATA fd;
625 | // if (NOERROR == SHGetDataFromIDList(lplvid->lpsf,lplvid->pidl,
626 | // SHGDFIL_FINDDATA,&fd,sizeof(WIN32_FIND_DATA)))
627 | // {
628 | // if ((fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ||
629 | // (fd.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM))
630 | // {
631 | // lpdi->item.mask |= LVIF_STATE;
632 | // lpdi->item.stateMask |= LVIS_CUT;
633 | // lpdi->item.state |= LVIS_CUT;
634 | // }
635 | // }
636 |
637 | // }
638 |
639 | //}
640 |
641 | // Set values
642 | lpdi->item.mask |= LVIF_DI_SETITEM;
643 |
644 | return TRUE;
645 |
646 | }
647 |
648 |
649 | //=============================================================================
650 | //
651 | // DirList_DeleteItem()
652 | //
653 | // Must be called in response to a WM_NOTIFY/LVN_DELETEITEM message
654 | // from the control
655 | //
656 | BOOL DirList_DeleteItem(HWND hwnd,LPARAM lParam)
657 | {
658 |
659 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
660 |
661 | LV_ITEM lvi;
662 | //LPMALLOC lpMalloc;
663 |
664 | NM_LISTVIEW *lpnmlv = (LPVOID)lParam;
665 |
666 | lvi.iItem = lpnmlv->iItem;
667 | lvi.iSubItem = 0;
668 | lvi.mask = LVIF_PARAM;
669 |
670 | if (ListView_GetItem(hwnd,&lvi))
671 | {
672 |
673 | //if (NOERROR == SHGetMalloc(&lpMalloc))
674 | //{
675 |
676 | // Free mem
677 | LPLV_ITEMDATA lplvid = (LPLV_ITEMDATA)lvi.lParam;
678 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,lplvid->pidl);
679 | lplvid->lpsf->lpVtbl->Release(lplvid->lpsf);
680 |
681 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,lplvid);
682 |
683 | //lpMalloc->lpVtbl->Release(lpMalloc);
684 |
685 | return TRUE;
686 |
687 | //}
688 |
689 | }
690 |
691 | else
692 | return FALSE;
693 |
694 | }
695 |
696 |
697 | //=============================================================================
698 | //
699 | // DirList_CompareProc()
700 | //
701 | // Compares two list items
702 | //
703 | int CALLBACK DirList_CompareProcFw(LPARAM lp1,LPARAM lp2,LPARAM lFlags)
704 | {
705 |
706 | HRESULT hr;
707 | int result;
708 |
709 | LPLV_ITEMDATA lplvid1 = (LPLV_ITEMDATA)lp1;
710 | LPLV_ITEMDATA lplvid2 = (LPLV_ITEMDATA)lp2;
711 |
712 | hr = (lplvid1->lpsf->lpVtbl->CompareIDs(
713 | lplvid1->lpsf,
714 | lFlags,
715 | lplvid1->pidl,
716 | lplvid2->pidl));
717 |
718 | result = (short)(SCODE_CODE(GetScode(hr)));
719 |
720 | if (result != 0 || lFlags == 0)
721 | return(result);
722 |
723 | hr = (lplvid1->lpsf->lpVtbl->CompareIDs(
724 | lplvid1->lpsf,
725 | 0,
726 | lplvid1->pidl,
727 | lplvid2->pidl));
728 |
729 | result = (short)(SCODE_CODE(GetScode(hr)));
730 |
731 | return(result);
732 |
733 | }
734 |
735 | int CALLBACK DirList_CompareProcRw(LPARAM lp1,LPARAM lp2,LPARAM lFlags)
736 | {
737 |
738 | HRESULT hr;
739 | int result;
740 |
741 | LPLV_ITEMDATA lplvid1 = (LPLV_ITEMDATA)lp1;
742 | LPLV_ITEMDATA lplvid2 = (LPLV_ITEMDATA)lp2;
743 |
744 | hr = (lplvid1->lpsf->lpVtbl->CompareIDs(
745 | lplvid1->lpsf,
746 | lFlags,
747 | lplvid1->pidl,
748 | lplvid2->pidl));
749 |
750 | result = -(short)(SCODE_CODE(GetScode(hr)));
751 |
752 | if (result != 0)
753 | return(result);
754 |
755 | hr = (lplvid1->lpsf->lpVtbl->CompareIDs(
756 | lplvid1->lpsf,
757 | 0,
758 | lplvid1->pidl,
759 | lplvid2->pidl));
760 |
761 | result = -(short)(SCODE_CODE(GetScode(hr)));
762 |
763 | return(result);
764 |
765 | }
766 |
767 |
768 | //=============================================================================
769 | //
770 | // DirList_Sort()
771 | //
772 | // Sorts the listview control by the specified order
773 | //
774 | BOOL DirList_Sort(HWND hwnd,int lFlags,BOOL fRev)
775 | {
776 |
777 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
778 |
779 | if (fRev)
780 |
781 | return ListView_SortItems(hwnd,DirList_CompareProcRw,lFlags);
782 |
783 | else
784 |
785 | return ListView_SortItems(hwnd,DirList_CompareProcFw,lFlags);
786 |
787 | }
788 |
789 |
790 | //=============================================================================
791 | //
792 | // DirList_GetItem()
793 | //
794 | // Copies the data of the specified item in the listview control to a buffer
795 | //
796 | int DirList_GetItem(HWND hwnd,int iItem,LPDLITEM lpdli)
797 | {
798 |
799 | LV_ITEM lvi;
800 | LPLV_ITEMDATA lplvid;
801 |
802 | ULONG dwAttributes = SFGAO_FILESYSTEM;
803 |
804 |
805 | if (iItem == -1)
806 | {
807 |
808 | if (ListView_GetSelectedCount(hwnd))
809 |
810 | iItem = ListView_GetNextItem(hwnd,-1,LVNI_ALL | LVNI_SELECTED);
811 |
812 | else
813 |
814 | return(-1);
815 |
816 | }
817 |
818 | lvi.mask = LVIF_PARAM;
819 | lvi.iItem = iItem;
820 | lvi.iSubItem = 0;
821 |
822 | if (!ListView_GetItem(hwnd,&lvi))
823 | {
824 |
825 | if (lpdli->mask & DLI_TYPE)
826 |
827 | lpdli->ntype = DLE_NONE;
828 |
829 | return(-1);
830 |
831 | }
832 |
833 | lplvid = (LPLV_ITEMDATA)lvi.lParam;
834 |
835 | // Filename
836 | if (lpdli->mask & DLI_FILENAME)
837 |
838 | IL_GetDisplayName(lplvid->lpsf,lplvid->pidl,SHGDN_FORPARSING,
839 | lpdli->szFileName,MAX_PATH);
840 |
841 | // Displayname
842 | if (lpdli->mask & DLI_DISPNAME)
843 |
844 | IL_GetDisplayName(lplvid->lpsf,lplvid->pidl,SHGDN_INFOLDER,
845 | lpdli->szDisplayName,MAX_PATH);
846 |
847 | // Type (File / Directory)
848 | if (lpdli->mask & DLI_TYPE)
849 | {
850 |
851 | WIN32_FIND_DATA fd;
852 |
853 | if (NOERROR == SHGetDataFromIDList(lplvid->lpsf,
854 | lplvid->pidl,
855 | SHGDFIL_FINDDATA,
856 | &fd,
857 | sizeof(WIN32_FIND_DATA)))
858 |
859 | lpdli->ntype = (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ?
860 | DLE_DIR : DLE_FILE;
861 |
862 | /*lplvid->lpsf->lpVtbl->GetAttributesOf(
863 | lplvid->lpsf,
864 | 1,
865 | &lplvid->pidl,
866 | &dwAttributes);
867 |
868 | lpdli->ntype = (dwAttributes & SFGAO_FOLDER) ? DLE_DIR : DLE_FILE;*/
869 |
870 | }
871 |
872 | return iItem;
873 |
874 | }
875 |
876 |
877 | //=============================================================================
878 | //
879 | // DirList_GetItemEx()
880 | //
881 | // Retrieves extended infomration on a dirlist item
882 | //
883 | int DirList_GetItemEx(HWND hwnd,int iItem,LPWIN32_FIND_DATA pfd)
884 | {
885 |
886 | LV_ITEM lvi;
887 | LPLV_ITEMDATA lplvid;
888 |
889 |
890 | if (iItem == -1)
891 | {
892 |
893 | if (ListView_GetSelectedCount(hwnd))
894 |
895 | iItem = ListView_GetNextItem(hwnd,-1,LVNI_ALL | LVNI_SELECTED);
896 |
897 | else
898 |
899 | return(-1);
900 |
901 | }
902 |
903 | lvi.mask = LVIF_PARAM;
904 | lvi.iItem = iItem;
905 | lvi.iSubItem = 0;
906 |
907 | if (!ListView_GetItem(hwnd,&lvi))
908 | return(-1);
909 |
910 | lplvid = (LPLV_ITEMDATA)lvi.lParam;
911 |
912 | if (NOERROR == SHGetDataFromIDList(lplvid->lpsf,
913 | lplvid->pidl,
914 | SHGDFIL_FINDDATA,
915 | pfd,
916 | sizeof(WIN32_FIND_DATA)))
917 | return iItem;
918 |
919 | else
920 | return(-1);
921 |
922 | }
923 |
924 |
925 | //=============================================================================
926 | //
927 | // DirList_PropertyDlg()
928 | //
929 | // Shows standard Win95 Property Dlg for selected Item
930 | //
931 | BOOL DirList_PropertyDlg(HWND hwnd,int iItem)
932 | {
933 |
934 | LV_ITEM lvi;
935 | LPLV_ITEMDATA lplvid;
936 | LPCONTEXTMENU lpcm;
937 | CMINVOKECOMMANDINFO cmi;
938 | BOOL bSuccess = TRUE;
939 |
940 | static const char *lpVerb = "properties";
941 |
942 | if (iItem == -1)
943 | {
944 | if (ListView_GetSelectedCount(hwnd))
945 | iItem = ListView_GetNextItem(hwnd,-1,LVNI_ALL | LVNI_SELECTED);
946 |
947 | else
948 | return FALSE;
949 | }
950 |
951 | lvi.mask = LVIF_PARAM;
952 | lvi.iItem = iItem;
953 | lvi.iSubItem = 0;
954 |
955 | if (!ListView_GetItem(hwnd,&lvi))
956 | return FALSE;
957 |
958 | lplvid = (LPLV_ITEMDATA)lvi.lParam;
959 |
960 | if (NOERROR == lplvid->lpsf->lpVtbl->GetUIObjectOf(
961 | lplvid->lpsf,
962 | GetParent(hwnd), // Owner
963 | 1, // Number of objects
964 | &lplvid->pidl, // pidl
965 | &IID_IContextMenu,
966 | NULL,
967 | &lpcm))
968 | {
969 |
970 | cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
971 | cmi.fMask = 0;
972 | cmi.hwnd = GetParent(hwnd);
973 | cmi.lpVerb = lpVerb;
974 | cmi.lpParameters = NULL;
975 | cmi.lpDirectory = NULL;
976 | cmi.nShow = SW_SHOWNORMAL;
977 | cmi.dwHotKey = 0;
978 | cmi.hIcon = NULL;
979 |
980 | if (NOERROR != lpcm->lpVtbl->InvokeCommand(lpcm,&cmi))
981 | bSuccess = FALSE;
982 |
983 | lpcm->lpVtbl->Release(lpcm);
984 |
985 | }
986 |
987 | else
988 | bSuccess = FALSE;
989 |
990 | return(bSuccess);
991 |
992 | }
993 |
994 |
995 |
996 | //=============================================================================
997 | //
998 | // DirList_DoDragDrop()
999 | //
1000 | // Execute an OLE Drag & Drop Operation in response to LVN_BEGIN(R)DRAG
1001 | //
1002 | //extern LPDROPSOURCE CreateDropSource();
1003 |
1004 | void DirList_DoDragDrop(HWND hwnd,LPARAM lParam)
1005 | {
1006 |
1007 | //LV_ITEM lvi;
1008 | //LPLV_ITEMDATA lplvid;
1009 | //LPDATAOBJECT lpdo;
1010 | //LPDROPSOURCE lpds;
1011 | //DWORD dwEffect;
1012 | //NM_LISTVIEW *pnmlv = (LPVOID)lParam;
1013 |
1014 | //lvi.iItem = pnmlv->iItem;
1015 | //lvi.iSubItem = 0;
1016 | //lvi.mask = LVIF_PARAM;
1017 |
1018 | //if (ListView_GetItem(hwnd,&lvi))
1019 | //{
1020 |
1021 | // lplvid = (LPLV_ITEMDATA)lvi.lParam;
1022 |
1023 | // if (SUCCEEDED(lplvid->lpsf->lpVtbl->GetUIObjectOf(
1024 | // lplvid->lpsf,
1025 | // GetParent(hwnd),
1026 | // 1,
1027 | // &lplvid->pidl,
1028 | // &IID_IDataObject,
1029 | // NULL,
1030 | // &lpdo)))
1031 | // {
1032 |
1033 | // lpds = CreateDropSource();
1034 |
1035 | // DoDragDrop(lpdo,lpds,DROPEFFECT_COPY|DROPEFFECT_MOVE|DROPEFFECT_LINK,&dwEffect);
1036 |
1037 | // lpdo->lpVtbl->Release(lpdo);
1038 | // lpds->lpVtbl->Release(lpds);
1039 |
1040 | // }
1041 | //}
1042 | }
1043 |
1044 |
1045 |
1046 | //=============================================================================
1047 | //
1048 | // DirList_GetLongPathName()
1049 | //
1050 | // Get long pathname for currently displayed directory
1051 | //
1052 | BOOL DirList_GetLongPathName(HWND hwnd,LPWSTR lpszLongPath)
1053 | {
1054 | WCHAR tch[MAX_PATH];
1055 | LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
1056 | if (SHGetPathFromIDList(lpdl->pidl,tch))
1057 | {
1058 | lstrcpy(lpszLongPath,tch);
1059 | return(TRUE);
1060 | }
1061 | else
1062 | return(FALSE);
1063 | }
1064 |
1065 |
1066 |
1067 | //=============================================================================
1068 | //
1069 | // DirList_SelectItem()
1070 | //
1071 | // Select specified item in the list
1072 | //
1073 | BOOL DirList_SelectItem(HWND hwnd,LPCWSTR lpszDisplayName,LPCWSTR lpszFullPath)
1074 | {
1075 |
1076 | #define LVIS_FLAGS LVIS_SELECTED|LVIS_FOCUSED
1077 |
1078 | WCHAR szShortPath[MAX_PATH];
1079 | SHFILEINFO shfi;
1080 |
1081 | LV_FINDINFO lvfi;
1082 | DLITEM dli;
1083 |
1084 | int i = -1;
1085 |
1086 | if (!lpszFullPath || !lstrlen(lpszFullPath))
1087 | return(FALSE);
1088 | else
1089 | GetShortPathName(lpszFullPath,szShortPath,MAX_PATH);
1090 |
1091 | if (!lpszDisplayName || !lstrlen(lpszDisplayName))
1092 | SHGetFileInfo(lpszFullPath,0,&shfi,sizeof(SHFILEINFO),SHGFI_DISPLAYNAME);
1093 | else
1094 | lstrcpyn(shfi.szDisplayName,lpszDisplayName,MAX_PATH);
1095 |
1096 | lvfi.flags = LVFI_STRING;
1097 | lvfi.psz = shfi.szDisplayName;
1098 |
1099 | dli.mask = DLI_ALL;
1100 |
1101 | while ((i = ListView_FindItem(hwnd,i,&lvfi)) != -1)
1102 | {
1103 |
1104 | DirList_GetItem(hwnd,i,&dli);
1105 | GetShortPathName(dli.szFileName,dli.szFileName,MAX_PATH);
1106 |
1107 | if (!lstrcmpi(dli.szFileName,szShortPath))
1108 | {
1109 | ListView_SetItemState(hwnd,i,LVIS_FLAGS,LVIS_FLAGS);
1110 | ListView_EnsureVisible(hwnd,i,FALSE);
1111 |
1112 | return(TRUE);
1113 | }
1114 |
1115 | }
1116 |
1117 | return(FALSE);
1118 |
1119 | }
1120 |
1121 |
1122 |
1123 | //=============================================================================
1124 | //
1125 | // DirList_CreateFilter()
1126 | //
1127 | // Create a valid DL_FILTER structure
1128 | //
1129 | void DirList_CreateFilter(PDL_FILTER pdlf,LPCWSTR lpszFileSpec,
1130 | BOOL bExcludeFilter)
1131 | {
1132 |
1133 | WCHAR *p;
1134 |
1135 | ZeroMemory(pdlf,sizeof(DL_FILTER));
1136 | lstrcpyn(pdlf->tFilterBuf,lpszFileSpec,(DL_FILTER_BUFSIZE-1));
1137 | pdlf->bExcludeFilter = bExcludeFilter;
1138 |
1139 | if (!lstrcmp(lpszFileSpec,L"*.*") || !lstrlen(lpszFileSpec))
1140 | return;
1141 |
1142 | pdlf->nCount = 1;
1143 | pdlf->pFilter[0] = &pdlf->tFilterBuf[0]; // Zeile zum Ausprobieren
1144 |
1145 | while (p = StrChr(pdlf->pFilter[pdlf->nCount-1],L';'))
1146 | {
1147 | *p = L'\0'; // Replace L';' by L'\0'
1148 | pdlf->pFilter[pdlf->nCount] = (p + 1); // Next position after L';'
1149 | pdlf->nCount++; // Increase number of filters
1150 | }
1151 |
1152 | }
1153 |
1154 |
1155 |
1156 | //=============================================================================
1157 | //
1158 | // DirList_MatchFilter()
1159 | //
1160 | // Check if a specified item matches a given filter
1161 | //
1162 | BOOL DirList_MatchFilter(LPSHELLFOLDER lpsf,LPCITEMIDLIST pidl,PDL_FILTER pdlf)
1163 | {
1164 |
1165 | int i;
1166 | WIN32_FIND_DATA fd;
1167 | BOOL bMatchSpec;
1168 |
1169 | // Immediately return true if lpszFileSpec is *.* or NULL
1170 | if (pdlf->nCount == 0 && !pdlf->bExcludeFilter)
1171 | return TRUE;
1172 |
1173 | SHGetDataFromIDList(lpsf,pidl,SHGDFIL_FINDDATA,&fd,sizeof(WIN32_FIND_DATA));
1174 |
1175 | // All the directories are added
1176 | if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
1177 | return(TRUE);
1178 |
1179 | // Check if exclude *.* after directories have been added
1180 | if (pdlf->nCount == 0 && pdlf->bExcludeFilter)
1181 | return FALSE;
1182 |
1183 | for (i = 0; i < pdlf->nCount; i++)
1184 | {
1185 | if (*pdlf->pFilter[i]) // Filters like L"\0" are ignored
1186 | {
1187 | bMatchSpec = PathMatchSpec(fd.cFileName,pdlf->pFilter[i]);
1188 | if (bMatchSpec)
1189 | {
1190 | if (!pdlf->bExcludeFilter)
1191 | return(TRUE);
1192 | else
1193 | return(FALSE);
1194 | }
1195 | }
1196 | }
1197 |
1198 | // No matching
1199 | return(pdlf->bExcludeFilter)?TRUE:FALSE;
1200 |
1201 | }
1202 |
1203 |
1204 |
1205 | //==== DriveBox ===============================================================
1206 |
1207 | //=============================================================================
1208 | //
1209 | // Internal Itemdata Structure
1210 | //
1211 | typedef struct tagDC_ITEMDATA
1212 | {
1213 |
1214 | LPITEMIDLIST pidl;
1215 | LPSHELLFOLDER lpsf;
1216 |
1217 | } DC_ITEMDATA, *LPDC_ITEMDATA;
1218 |
1219 |
1220 | //=============================================================================
1221 | //
1222 | // DriveBox_Init()
1223 | //
1224 | // Initializes the drive box
1225 | //
1226 | BOOL DriveBox_Init(HWND hwnd)
1227 | {
1228 |
1229 | HIMAGELIST hil;
1230 | SHFILEINFO shfi;
1231 |
1232 | hil = (HIMAGELIST)SHGetFileInfo(L"C:\\",0,&shfi,sizeof(SHFILEINFO),
1233 | SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
1234 | SendMessage(hwnd,CBEM_SETIMAGELIST,0,(LPARAM)hil);
1235 | SendMessage(hwnd,CBEM_SETEXTENDEDSTYLE,CBES_EX_NOSIZELIMIT,CBES_EX_NOSIZELIMIT);
1236 |
1237 | return TRUE;
1238 |
1239 | }
1240 |
1241 |
1242 | //=============================================================================
1243 | //
1244 | // DriveBox_Fill
1245 | //
1246 |
1247 | int DriveBox_Fill(HWND hwnd)
1248 | {
1249 |
1250 | //LPMALLOC lpMalloc;
1251 |
1252 | LPSHELLFOLDER lpsfDesktop;
1253 | LPSHELLFOLDER lpsf; // Workspace == CSIDL_DRIVES
1254 |
1255 | LPITEMIDLIST pidl;
1256 | LPITEMIDLIST pidlEntry;
1257 |
1258 | LPENUMIDLIST lpe;
1259 |
1260 | COMBOBOXEXITEM cbei;
1261 | LPDC_ITEMDATA lpdcid;
1262 |
1263 | ULONG dwAttributes = 0;
1264 |
1265 | DWORD grfFlags = SHCONTF_FOLDERS;
1266 |
1267 |
1268 | // Init ComboBox
1269 | SendMessage(hwnd,WM_SETREDRAW,0,0);
1270 | SendMessage(hwnd,CB_RESETCONTENT,0,0);
1271 |
1272 | ZeroMemory(&cbei,sizeof(COMBOBOXEXITEM));
1273 | cbei.mask = CBEIF_TEXT | CBEIF_IMAGE | CBEIF_SELECTEDIMAGE | CBEIF_LPARAM;
1274 | cbei.pszText = LPSTR_TEXTCALLBACK;
1275 | cbei.cchTextMax = MAX_PATH;
1276 | cbei.iImage = I_IMAGECALLBACK;
1277 | cbei.iSelectedImage = I_IMAGECALLBACK;
1278 |
1279 | // Get Shell's IMalloc Interface
1280 | //if (NOERROR == SHGetMalloc(&lpMalloc))
1281 | //{
1282 |
1283 | // Get pidl to [My Computer]
1284 | if (NOERROR == SHGetSpecialFolderLocation(hwnd,
1285 | CSIDL_DRIVES,
1286 | &pidl))
1287 | {
1288 |
1289 | // Get Desktop Folder
1290 | if (NOERROR == SHGetDesktopFolder(&lpsfDesktop))
1291 | {
1292 |
1293 | // Bind pidl to IShellFolder
1294 | if (NOERROR == lpsfDesktop->lpVtbl->BindToObject(
1295 | lpsfDesktop,
1296 | pidl,
1297 | NULL,
1298 | &IID_IShellFolder,
1299 | &lpsf))
1300 |
1301 | {
1302 |
1303 | // Create an Enumeration object for lpsf
1304 | if (NOERROR == lpsf->lpVtbl->EnumObjects(
1305 | lpsf,
1306 | hwnd,
1307 | grfFlags,
1308 | &lpe))
1309 |
1310 | {
1311 |
1312 | // Enumerate the contents of [My Computer]
1313 | while (NOERROR == lpe->lpVtbl->Next(
1314 | lpe,
1315 | 1,
1316 | &pidlEntry,
1317 | NULL))
1318 |
1319 | {
1320 |
1321 | // Add item to the List if it is part of the
1322 | // Filesystem
1323 | dwAttributes = SFGAO_FILESYSTEM;
1324 |
1325 | lpsf->lpVtbl->GetAttributesOf(
1326 | lpsf,
1327 | 1,
1328 | &pidlEntry,
1329 | &dwAttributes);
1330 |
1331 | if (dwAttributes & SFGAO_FILESYSTEM)
1332 | {
1333 |
1334 | // Windows XP: check if pidlEntry is a drive
1335 | SHDESCRIPTIONID di;
1336 | HRESULT hr;
1337 | hr = SHGetDataFromIDList(lpsf,pidlEntry,SHGDFIL_DESCRIPTIONID,
1338 | &di,sizeof(SHDESCRIPTIONID));
1339 | if (hr != NOERROR || (di.dwDescriptionId >= SHDID_COMPUTER_DRIVE35 &&
1340 | di.dwDescriptionId <= SHDID_COMPUTER_OTHER))
1341 | {
1342 |
1343 | lpdcid = g_lpMalloc->lpVtbl->Alloc(
1344 | g_lpMalloc,
1345 | sizeof(DC_ITEMDATA));
1346 |
1347 | //lpdcid->pidl = IL_Copy(lpMalloc,pidlEntry);
1348 | lpdcid->pidl = pidlEntry;
1349 | lpdcid->lpsf = lpsf;
1350 |
1351 | lpsf->lpVtbl->AddRef(lpsf);
1352 |
1353 | // Insert sorted ...
1354 | {
1355 | COMBOBOXEXITEM cbei2;
1356 | LPDC_ITEMDATA lpdcid2;
1357 | HRESULT hr;
1358 | cbei2.mask = CBEIF_LPARAM;
1359 | cbei2.iItem = 0;
1360 |
1361 | while ((SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei2)))
1362 | {
1363 | lpdcid2 = (LPDC_ITEMDATA)cbei2.lParam;
1364 | hr = (lpdcid->lpsf->lpVtbl->CompareIDs(
1365 | lpdcid->lpsf,
1366 | 0,
1367 | lpdcid->pidl,
1368 | lpdcid2->pidl));
1369 |
1370 | if ((short)(SCODE_CODE(GetScode(hr))) < 0)
1371 | break;
1372 | else
1373 | cbei2.iItem++;
1374 | }
1375 |
1376 | cbei.iItem = cbei2.iItem;
1377 | cbei.lParam = (LPARAM)lpdcid;
1378 | SendMessage(hwnd,CBEM_INSERTITEM,0,(LPARAM)&cbei);
1379 |
1380 | }
1381 |
1382 | }
1383 |
1384 | }
1385 |
1386 | //lpMalloc->lpVtbl->Free(lpMalloc,pidlEntry);
1387 |
1388 | } // IEnumIDList::Next()
1389 |
1390 | lpe->lpVtbl->Release(lpe);
1391 |
1392 | } // IShellFolder::EnumObjects()
1393 |
1394 | lpsf->lpVtbl->Release(lpsf);
1395 |
1396 | } // IShellFolder::BindToObject()
1397 |
1398 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,pidl);
1399 |
1400 | } // SHGetSpecialFolderLocation()
1401 |
1402 | lpsfDesktop->lpVtbl->Release(lpsfDesktop);
1403 |
1404 | } // SHGetDesktopFolder()
1405 |
1406 | //lpMalloc->lpVtbl->Release(lpMalloc);
1407 |
1408 | //} // SHGetMalloc()
1409 |
1410 |
1411 | SendMessage(hwnd,WM_SETREDRAW,1,0);
1412 | // Return number of items added to combo box
1413 | return (SendMessage(hwnd,CB_GETCOUNT,0,0));
1414 |
1415 | }
1416 |
1417 |
1418 | //=============================================================================
1419 | //
1420 | // DriveBox_GetSelDrive
1421 | //
1422 | BOOL DriveBox_GetSelDrive(HWND hwnd,LPWSTR lpszDrive,int nDrive,BOOL fNoSlash)
1423 | {
1424 |
1425 | COMBOBOXEXITEM cbei;
1426 | LPDC_ITEMDATA lpdcid;
1427 | int i = SendMessage(hwnd,CB_GETCURSEL,0,0);
1428 |
1429 | // CB_ERR means no Selection
1430 | if (i == CB_ERR)
1431 | return FALSE;
1432 |
1433 | // Get DC_ITEMDATA* of selected Item
1434 | cbei.mask = CBEIF_LPARAM;
1435 | cbei.iItem = i;
1436 | SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei);
1437 | lpdcid = (LPDC_ITEMDATA)cbei.lParam;
1438 |
1439 | // Get File System Path for Drive
1440 | IL_GetDisplayName(lpdcid->lpsf,lpdcid->pidl,SHGDN_FORPARSING,lpszDrive,nDrive);
1441 |
1442 | // Remove Backslash if required (makes Drive relative!!!)
1443 | if (fNoSlash)
1444 | PathRemoveBackslash(lpszDrive);
1445 |
1446 | return TRUE;
1447 |
1448 | }
1449 |
1450 |
1451 | //=============================================================================
1452 | //
1453 | // DriveBox_SelectDrive
1454 | //
1455 | BOOL DriveBox_SelectDrive(HWND hwnd,LPCWSTR lpszPath)
1456 | {
1457 |
1458 | COMBOBOXEXITEM cbei;
1459 | LPDC_ITEMDATA lpdcid;
1460 | WCHAR szRoot[64];
1461 |
1462 | int i;
1463 | int cbItems = SendMessage(hwnd,CB_GETCOUNT,0,0);
1464 |
1465 | // No Drives in Combo Box
1466 | if (!cbItems)
1467 | return FALSE;
1468 |
1469 | cbei.mask = CBEIF_LPARAM;
1470 |
1471 | for (i = 0; i < cbItems; i++)
1472 | {
1473 | // Get DC_ITEMDATA* of Item i
1474 | cbei.iItem = i;
1475 | SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei);
1476 | lpdcid = (LPDC_ITEMDATA)cbei.lParam;
1477 |
1478 | // Get File System Path for Drive
1479 | IL_GetDisplayName(lpdcid->lpsf,lpdcid->pidl,SHGDN_FORPARSING,szRoot,64);
1480 |
1481 | // Compare Root Directory with Path
1482 | if (PathIsSameRoot(lpszPath,szRoot))
1483 | {
1484 | // Select matching Drive
1485 | SendMessage(hwnd,CB_SETCURSEL,i,0);
1486 | return TRUE;
1487 | }
1488 | }
1489 |
1490 | // Don't select anything
1491 | SendMessage(hwnd,CB_SETCURSEL,(WPARAM)-1,0);
1492 | return FALSE;
1493 |
1494 | }
1495 |
1496 |
1497 | //=============================================================================
1498 | //
1499 | // DriveBox_PropertyDlg()
1500 | //
1501 | // Shows standard Win95 Property Dlg for selected Drive
1502 | //
1503 | BOOL DriveBox_PropertyDlg(HWND hwnd)
1504 | {
1505 |
1506 | COMBOBOXEXITEM cbei;
1507 | LPDC_ITEMDATA lpdcid;
1508 | int iItem;
1509 | LPCONTEXTMENU lpcm;
1510 | CMINVOKECOMMANDINFO cmi;
1511 | BOOL bSuccess = TRUE;
1512 |
1513 | static const char *lpVerb = "properties";
1514 |
1515 | iItem = SendMessage(hwnd,CB_GETCURSEL,0,0);
1516 |
1517 | if (iItem == CB_ERR)
1518 | return FALSE;
1519 |
1520 | cbei.mask = CBEIF_LPARAM;
1521 | cbei.iItem = iItem;
1522 | SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei);
1523 | lpdcid = (LPDC_ITEMDATA)cbei.lParam;
1524 |
1525 | if (NOERROR == lpdcid->lpsf->lpVtbl->GetUIObjectOf(
1526 | lpdcid->lpsf,
1527 | GetParent(hwnd), // Owner
1528 | 1, // Number of objects
1529 | &lpdcid->pidl, // pidl
1530 | &IID_IContextMenu,
1531 | NULL,
1532 | &lpcm))
1533 | {
1534 |
1535 | cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
1536 | cmi.fMask = 0;
1537 | cmi.hwnd = GetParent(hwnd);
1538 | cmi.lpVerb = lpVerb;
1539 | cmi.lpParameters = NULL;
1540 | cmi.lpDirectory = NULL;
1541 | cmi.nShow = SW_SHOWNORMAL;
1542 | cmi.dwHotKey = 0;
1543 | cmi.hIcon = NULL;
1544 |
1545 | if (NOERROR != lpcm->lpVtbl->InvokeCommand(lpcm,&cmi))
1546 | bSuccess = FALSE;
1547 |
1548 | lpcm->lpVtbl->Release(lpcm);
1549 |
1550 | }
1551 |
1552 | else
1553 | bSuccess = FALSE;
1554 |
1555 | return(bSuccess);
1556 |
1557 | }
1558 |
1559 |
1560 | //=============================================================================
1561 | //
1562 | // DriveBox_DeleteItem
1563 | //
1564 | LRESULT DriveBox_DeleteItem(HWND hwnd,LPARAM lParam)
1565 | {
1566 |
1567 | //LPMALLOC lpMalloc;
1568 | NMCOMBOBOXEX *lpnmcbe;
1569 | COMBOBOXEXITEM cbei;
1570 | LPDC_ITEMDATA lpdcid;
1571 |
1572 | lpnmcbe = (LPVOID)lParam;
1573 | cbei.iItem = lpnmcbe->ceItem.iItem;
1574 |
1575 | cbei.mask = CBEIF_LPARAM;
1576 | SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei);
1577 | lpdcid = (LPDC_ITEMDATA)cbei.lParam;
1578 |
1579 | //SHGetMalloc(&lpMalloc);
1580 |
1581 | // Free pidl
1582 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdcid->pidl);
1583 | // Release lpsf
1584 | lpdcid->lpsf->lpVtbl->Release(lpdcid->lpsf);
1585 |
1586 | // Free lpdcid itself
1587 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdcid);
1588 |
1589 | // Release lpMalloc
1590 | //lpMalloc->lpVtbl->Release(lpMalloc);
1591 |
1592 | return TRUE;
1593 |
1594 | }
1595 |
1596 |
1597 | //=============================================================================
1598 | //
1599 | // DriveBox_GetDispInfo
1600 | //
1601 | LRESULT DriveBox_GetDispInfo(HWND hwnd,LPARAM lParam)
1602 | {
1603 |
1604 | NMCOMBOBOXEX *lpnmcbe;
1605 | LPDC_ITEMDATA lpdcid;
1606 | SHFILEINFO shfi;
1607 | WCHAR szTemp[256];
1608 |
1609 | lpnmcbe = (LPVOID)lParam;
1610 | lpdcid = (LPDC_ITEMDATA)lpnmcbe->ceItem.lParam;
1611 |
1612 | if (!lpdcid)
1613 | return FALSE;
1614 |
1615 | // Get Display Name
1616 | if (lpnmcbe->ceItem.mask & CBEIF_TEXT)
1617 | IL_GetDisplayName(lpdcid->lpsf,lpdcid->pidl,SHGDN_NORMAL,lpnmcbe->ceItem.pszText,lpnmcbe->ceItem.cchTextMax);
1618 |
1619 | // Get Icon Index
1620 | if (lpnmcbe->ceItem.mask & (CBEIF_IMAGE | CBEIF_SELECTEDIMAGE))
1621 | {
1622 | IL_GetDisplayName(lpdcid->lpsf,lpdcid->pidl,SHGDN_FORPARSING,szTemp,256);
1623 | SHGetFileInfo(szTemp,0,&shfi,sizeof(SHFILEINFO),SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
1624 | lpnmcbe->ceItem.iImage = shfi.iIcon;
1625 | lpnmcbe->ceItem.iSelectedImage = shfi.iIcon;
1626 | }
1627 |
1628 | // Set values
1629 | lpnmcbe->ceItem.mask |= CBEIF_DI_SETITEM;
1630 |
1631 | return TRUE;
1632 |
1633 | }
1634 |
1635 |
1636 |
1637 | //==== ItemID =================================================================
1638 |
1639 | //=============================================================================
1640 | //
1641 | // IL_Create()
1642 | //
1643 | // Creates an ITEMIDLIST by concatenating pidl1 and pidl2
1644 | // cb1 and cb2 indicate the sizes of the pidls, where cb1
1645 | // can be zero and pidl1 can be NULL
1646 | //
1647 | // If cb2 is zero, the size of pidl2 is retrieved using
1648 | // IL_GetSize(pidl2)
1649 | //
1650 | LPITEMIDLIST IL_Create(LPMALLOC lpMalloc,
1651 | LPCITEMIDLIST pidl1,UINT cb1,
1652 | LPCITEMIDLIST pidl2,UINT cb2)
1653 | {
1654 |
1655 | LPITEMIDLIST pidl;
1656 |
1657 | if (!pidl2)
1658 | return NULL;
1659 |
1660 | if (!cb2)
1661 | cb2 = IL_GetSize(pidl2) + 2; // Space for terminating Bytes
1662 |
1663 | if (!cb1)
1664 | cb1 = IL_GetSize(pidl1);
1665 |
1666 | // Allocate Memory
1667 | pidl = lpMalloc->lpVtbl->Alloc(lpMalloc,cb1 + cb2);
1668 |
1669 | // Init new ITEMIDLIST
1670 | if (pidl1)
1671 | CopyMemory(pidl,pidl1,cb1);
1672 |
1673 | // pidl2 can't be NULL here
1674 | CopyMemory((LPBYTE)pidl + cb1,pidl2,cb2);
1675 |
1676 | return pidl;
1677 |
1678 | }
1679 |
1680 |
1681 | //=============================================================================
1682 | //
1683 | // IL_GetSize()
1684 | //
1685 | // Retrieves the number of bytes in a pidl
1686 | // Does not add space for zero terminators !!
1687 | //
1688 | UINT IL_GetSize(LPCITEMIDLIST pidl)
1689 | {
1690 |
1691 | LPITEMIDLIST pidlTmp;
1692 | UINT cb = 0;
1693 |
1694 | if (!pidl)
1695 | return 0;
1696 |
1697 | for (pidlTmp = (LPITEMIDLIST)pidl;
1698 | pidlTmp->mkid.cb;
1699 | pidlTmp = _IL_Next(pidlTmp))
1700 |
1701 | cb += pidlTmp->mkid.cb;
1702 |
1703 |
1704 | return cb;
1705 |
1706 | }
1707 |
1708 |
1709 | //=============================================================================
1710 | //
1711 | // IL_GetDisplayName()
1712 | //
1713 | // Gets the Display Name of a pidl. lpsf is the parent IShellFolder Interface
1714 | // dwFlags specify a SHGDN_xx value
1715 | //
1716 | BOOL IL_GetDisplayName(LPSHELLFOLDER lpsf,
1717 | LPCITEMIDLIST pidl,
1718 | DWORD dwFlags,
1719 | LPWSTR lpszDisplayName,
1720 | int nDisplayName)
1721 | {
1722 |
1723 | STRRET str;
1724 |
1725 | if (NOERROR == lpsf->lpVtbl->GetDisplayNameOf(lpsf,
1726 | pidl,
1727 | dwFlags,
1728 | &str))
1729 | {
1730 |
1731 | // Shlwapi.dll provides new function:
1732 | return StrRetToBuf(&str,pidl,lpszDisplayName,nDisplayName);
1733 | // ...but I suppose my version is faster ;-)
1734 | /*switch (str.uType)
1735 | {
1736 |
1737 | case STRRET_WSTR:
1738 | WideCharToMultiByte(CP_ACP,
1739 | 0,
1740 | str.pOleStr,
1741 | -1,
1742 | lpszDisplayName,
1743 | nDisplayName,
1744 | NULL,
1745 | NULL);
1746 | g_lpMalloc->lpVtbl->Free(g_lpMalloc,str.pOleStr);
1747 | break;
1748 |
1749 | case STRRET_OFFSET:
1750 | lstrcpyn(lpszDisplayName,
1751 | ((WCHAR *)(pidl)) + str.uOffset,
1752 | nDisplayName);
1753 | break;
1754 |
1755 | case STRRET_CSTR:
1756 | lstrcpyn(lpszDisplayName,str.cStr,nDisplayName);
1757 | break;
1758 |
1759 | }
1760 |
1761 | return TRUE;*/
1762 | }
1763 |
1764 | return FALSE;
1765 | }
1766 |
1767 |
1768 |
1769 | /// End of Dlapi.c \\\
1770 |
--------------------------------------------------------------------------------
/src/Dlapi.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Dlapi.h
7 | * Definitions for Directory Listing APIs
8 | *
9 | * See Readme.txt for more information about this source code.
10 | * Please send me your comments to this work.
11 | *
12 | * See License.txt for details about distribution and modification.
13 | *
14 | * (c) Florian Balmer 1996-2010
15 | * florian.balmer@gmail.com
16 | * http://www.flos-freeware.ch
17 | *
18 | *
19 | ******************************************************************************/
20 |
21 | #ifndef _DLAPI_H_
22 | #define _DLAPI_H_
23 |
24 | #ifdef __cplusplus
25 | extern L"C" { // C-Declarations
26 | #endif //__cplusplus
27 |
28 |
29 |
30 | //==== DirList ================================================================
31 |
32 | //==== LV_ITEMDATA Structure ==================================================
33 | typedef struct tagLV_ITEMDATA // lvid
34 | {
35 | LPITEMIDLIST pidl; // Item Id
36 | LPSHELLFOLDER lpsf; // Parent IShellFolder Interface
37 |
38 | } LV_ITEMDATA, *LPLV_ITEMDATA;
39 |
40 |
41 | //==== DlInit() ===============================================================
42 |
43 | BOOL DirList_Init(HWND,LPCWSTR);
44 |
45 |
46 | //==== DlDestroy() ============================================================
47 |
48 | BOOL DirList_Destroy(HWND);
49 |
50 |
51 | //==== DlStartIconThread() ====================================================
52 |
53 | BOOL DirList_StartIconThread(HWND);
54 |
55 |
56 | //==== DlTerminateIconThread() ================================================
57 |
58 | BOOL DirList_TerminateIconThread(HWND);
59 |
60 |
61 | //==== DlFill() ===============================================================
62 |
63 | #define DL_FOLDERS 32
64 | #define DL_NONFOLDERS 64
65 | #define DL_INCLHIDDEN 128
66 | #define DL_ALLOBJECTS (32|64|128)
67 |
68 | int DirList_Fill(HWND,LPCWSTR,DWORD,LPCWSTR,BOOL,BOOL,int,BOOL);
69 |
70 |
71 | //==== DlIconThread() =========================================================
72 |
73 | DWORD WINAPI DirList_IconThread(LPVOID);
74 |
75 |
76 | //==== DlGetDispInfo() ========================================================
77 |
78 | BOOL DirList_GetDispInfo(HWND,LPARAM,BOOL);
79 |
80 |
81 | //==== DlDeleteItem() =========================================================
82 |
83 | BOOL DirList_DeleteItem(HWND,LPARAM);
84 |
85 |
86 | //==== DlSort() ===============================================================
87 |
88 | #define DS_NAME 0
89 | #define DS_SIZE 1
90 | #define DS_TYPE 2
91 | #define DS_LASTMOD 3
92 |
93 | BOOL DirList_Sort(HWND,int,BOOL);
94 |
95 |
96 | //==== DlGetItem() ============================================================
97 |
98 | #define DLE_NONE 0
99 | #define DLE_DIR 1
100 | #define DLE_FILE 2
101 |
102 | #define DLI_FILENAME 1
103 | #define DLI_DISPNAME 2
104 | #define DLI_TYPE 4
105 | #define DLI_ALL (1|2|4)
106 |
107 | typedef struct tagDLITEM // dli
108 | {
109 |
110 | UINT mask;
111 | WCHAR szFileName[MAX_PATH];
112 | WCHAR szDisplayName[MAX_PATH];
113 | int ntype;
114 |
115 | } DLITEM, *LPDLITEM;
116 |
117 | DirList_GetItem(HWND,int,LPDLITEM);
118 |
119 |
120 | //==== DlGetItemEx() ==========================================================
121 |
122 | int DirList_GetItemEx(HWND,int,LPWIN32_FIND_DATA);
123 |
124 |
125 | //==== DlPropertyDlg() ========================================================
126 |
127 | BOOL DirList_PropertyDlg(HWND,int);
128 |
129 |
130 | //==== DlDoDragDrop() =========================================================
131 |
132 | void DirList_DoDragDrop(HWND,LPARAM);
133 |
134 | //==== DlGetLongPathName() ====================================================
135 |
136 | BOOL DirList_GetLongPathName(HWND,LPWSTR);
137 |
138 | //==== DlSelectItem() =========================================================
139 |
140 | BOOL DirList_SelectItem(HWND,LPCWSTR,LPCWSTR);
141 |
142 | //==== DlCreateFilter() and DlMatchFilter() ===================================
143 |
144 | #define DL_FILTER_BUFSIZE 128
145 |
146 | typedef struct tagDL_FILTER { //dlf
147 | int nCount;
148 | WCHAR tFilterBuf[DL_FILTER_BUFSIZE];
149 | WCHAR *pFilter [DL_FILTER_BUFSIZE];
150 | BOOL bExcludeFilter;
151 | } DL_FILTER, *PDL_FILTER;
152 |
153 | void DirList_CreateFilter(PDL_FILTER,LPCWSTR,BOOL);
154 |
155 | BOOL DirList_MatchFilter(LPSHELLFOLDER,LPCITEMIDLIST,PDL_FILTER);
156 |
157 |
158 |
159 | //==== DriveBox ===============================================================
160 |
161 | BOOL DriveBox_Init(HWND);
162 | int DriveBox_Fill(HWND);
163 | BOOL DriveBox_GetSelDrive(HWND,LPWSTR,int,BOOL);
164 | BOOL DriveBox_SelectDrive(HWND,LPCWSTR);
165 | BOOL DriveBox_PropertyDlg(HWND);
166 |
167 | LRESULT DriveBox_DeleteItem(HWND,LPARAM);
168 | LRESULT DriveBox_GetDispInfo(HWND,LPARAM);
169 |
170 |
171 |
172 | //==== ItemID =================================================================
173 |
174 | //==== IL_Next() ==============================================================
175 | #define _IL_Next(pidl) ((LPITEMIDLIST)(((LPBYTE)(pidl)) + pidl->mkid.cb))
176 |
177 | //==== IL_Create() ============================================================
178 | LPITEMIDLIST IL_Create(LPMALLOC,
179 | LPCITEMIDLIST,UINT,
180 | LPCITEMIDLIST,UINT);
181 |
182 | //==== IL_GetSize() ===========================================================
183 | UINT IL_GetSize(LPCITEMIDLIST);
184 |
185 | //==== IL_GetDisplayName() ====================================================
186 | BOOL IL_GetDisplayName(LPSHELLFOLDER,
187 | LPCITEMIDLIST,
188 | DWORD,LPWSTR,int);
189 |
190 |
191 |
192 |
193 | #ifdef __cplusplus
194 | }
195 | #endif //__cplusplus
196 |
197 |
198 | #endif // _DLAPI_H_
199 |
200 |
201 | /// End of Dlapi.h \\\
202 |
--------------------------------------------------------------------------------
/src/Edit.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/src/Edit.c
--------------------------------------------------------------------------------
/src/Edit.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Edit.h
7 | * Text File Editing Helper Stuff
8 | *
9 | * See Readme.txt for more information about this source code.
10 | * Please send me your comments to this work.
11 | *
12 | * See License.txt for details about distribution and modification.
13 | *
14 | * (c) Florian Balmer 1996-2010
15 | * florian.balmer@gmail.com
16 | * http://www.flos-freeware.ch
17 | *
18 | *
19 | ******************************************************************************/
20 |
21 |
22 |
23 | // extern "C" declarations of Scintilla functions
24 | BOOL Scintilla_RegisterClasses(HINSTANCE);
25 | BOOL Scintilla_ReleaseResources();
26 |
27 |
28 | typedef struct _editfindreplace
29 | {
30 | char szFind[512];
31 | char szReplace[512];
32 | char szFindUTF8[3*512];
33 | char szReplaceUTF8[3*512];
34 | UINT fuFlags;
35 | BOOL bTransformBS;
36 | BOOL bObsolete /* was bFindUp */;
37 | BOOL bFindClose;
38 | BOOL bReplaceClose;
39 | BOOL bNoFindWrap;
40 | HWND hwnd;
41 | #ifdef BOOKMARK_EDITION
42 | BOOL bWildcardSearch;
43 | #endif
44 | //HANDLE hMRUFind;
45 | //HANDLE hMRUReplace;
46 |
47 | } EDITFINDREPLACE, *LPEDITFINDREPLACE, *LPCEDITFINDREPLACE;
48 |
49 |
50 | #define IDMSG_SWITCHTOFIND 204
51 | #define IDMSG_SWITCHTOREPLACE 205
52 |
53 |
54 | #define SORT_ASCENDING 0
55 | #define SORT_DESCENDING 1
56 | #define SORT_UNIQ 2
57 | #define SORT_LOGICAL 4
58 |
59 |
60 | HWND EditCreate(HWND);
61 | void EditSetNewText(HWND,char*,DWORD);
62 | BOOL EditConvertText(HWND,UINT,UINT,BOOL);
63 | BOOL EditSetNewEncoding(HWND,int,int,BOOL,BOOL);
64 | char* EditGetClipboardText(HWND);
65 | BOOL EditCopyAppend(HWND);
66 | int EditDetectEOLMode(HWND,char*,DWORD);
67 | BOOL EditLoadFile(HWND,LPCWSTR,BOOL,int*,int*,BOOL*,BOOL*);
68 | BOOL EditSaveFile(HWND,LPCWSTR,int,BOOL*,BOOL);
69 |
70 | void EditMakeUppercase(HWND);
71 | void EditMakeLowercase(HWND);
72 | void EditInvertCase(HWND);
73 | void EditTitleCase(HWND);
74 | void EditSentenceCase(HWND);
75 |
76 | void EditURLEncode(HWND);
77 | void EditURLDecode(HWND);
78 | void EditEscapeCChars(HWND);
79 | void EditUnescapeCChars(HWND);
80 | void EditModifyNumber(HWND,BOOL);
81 |
82 | void EditTabsToSpaces(HWND,int,BOOL);
83 | void EditSpacesToTabs(HWND,int,BOOL);
84 |
85 | void EditMoveUp(HWND);
86 | void EditMoveDown(HWND);
87 | void EditModifyLines(HWND,LPCWSTR,LPCWSTR);
88 | void EditEncloseSelection(HWND,LPCWSTR,LPCWSTR);
89 | void EditToggleLineComments(HWND,LPCWSTR,BOOL);
90 | void EditPadWithSpaces(HWND);
91 | void EditStripFirstCharacter(HWND);
92 | void EditStripLastCharacter(HWND);
93 | void EditStripTrailingBlanks(HWND,BOOL);
94 | void EditCompressSpaces(HWND);
95 | void EditRemoveBlankLines(HWND);
96 | void EditWrapToColumn(HWND,int);
97 | void EditJoinLinesEx(HWND);
98 | void EditSortLines(HWND,int);
99 |
100 | void EditJumpTo(HWND,int,int);
101 | void EditSelectEx(HWND,int,int);
102 | void EditGetExcerpt(HWND,LPWSTR,DWORD);
103 |
104 | HWND EditFindReplaceDlg(HWND,LPCEDITFINDREPLACE,BOOL);
105 | BOOL EditFindNext(HWND,LPCEDITFINDREPLACE,BOOL);
106 | BOOL EditFindPrev(HWND,LPCEDITFINDREPLACE,BOOL);
107 | BOOL EditReplace(HWND,LPCEDITFINDREPLACE);
108 | BOOL EditReplaceAll(HWND,LPCEDITFINDREPLACE,BOOL);
109 | BOOL EditReplaceAllInSelection(HWND,LPCEDITFINDREPLACE,BOOL);
110 | BOOL EditLinenumDlg(HWND);
111 | BOOL EditModifyLinesDlg(HWND,LPWSTR,LPWSTR);
112 | BOOL EditEncloseSelectionDlg(HWND,LPWSTR,LPWSTR);
113 | BOOL EditInsertTagDlg(HWND,LPWSTR,LPWSTR);
114 | BOOL EditSortDlg(HWND,int*);
115 | BOOL EditPrint(HWND,LPCWSTR,LPCWSTR);
116 | void EditPrintSetup(HWND);
117 | void EditPrintInit();
118 |
119 | #define NCP_DEFAULT 1
120 | #define NCP_UTF8 2
121 | #define NCP_UTF8_SIGN 4
122 | #define NCP_UNICODE 8
123 | #define NCP_UNICODE_REVERSE 16
124 | #define NCP_UNICODE_BOM 32
125 | #define NCP_8BIT 64
126 | #define NCP_INTERNAL (NCP_DEFAULT|NCP_UTF8|NCP_UTF8_SIGN|NCP_UNICODE|NCP_UNICODE_REVERSE|NCP_UNICODE_BOM)
127 | #define NCP_RECODE 128
128 | #define CPI_NONE -1
129 | #define CPI_DEFAULT 0
130 | #define CPI_OEM 1
131 | #define CPI_UNICODEBOM 2
132 | #define CPI_UNICODEBEBOM 3
133 | #define CPI_UNICODE 4
134 | #define CPI_UNICODEBE 5
135 | #define CPI_UTF8 6
136 | #define CPI_UTF8SIGN 7
137 | #define CPI_UTF7 8
138 |
139 | #define IDS_ENCODINGNAME0 61000
140 | #define IDS_EOLMODENAME0 62000
141 |
142 | typedef struct _np2encoding {
143 | UINT uFlags;
144 | UINT uCodePage;
145 | char* pszParseNames;
146 | int idsName;
147 | WCHAR wchLabel[32];
148 | } NP2ENCODING;
149 |
150 | void Encoding_InitDefaults();
151 | int Encoding_MapIniSetting(BOOL,int);
152 | void Encoding_GetLabel(int);
153 | int Encoding_MatchW(LPCWSTR);
154 | int Encoding_MatchA(char*);
155 | BOOL Encoding_IsValid(int);
156 | void Encoding_AddToListView(HWND,int,BOOL);
157 | BOOL Encoding_GetFromListView(HWND,int *);
158 | void Encoding_AddToComboboxEx(HWND,int,BOOL);
159 | BOOL Encoding_GetFromComboboxEx(HWND,int *);
160 |
161 | BOOL IsUnicode(const char*,int,LPBOOL,LPBOOL);
162 | BOOL IsUTF8(const char*,int);
163 | BOOL IsUTF7(const char*,int);
164 |
165 |
166 | //void SciInitThemes(HWND);
167 | //LRESULT CALLBACK SciThemedWndProc(HWND,UINT,WPARAM,LPARAM);
168 |
169 |
170 | #define FV_TABWIDTH 1
171 | #define FV_INDENTWIDTH 2
172 | #define FV_TABSASSPACES 4
173 | #define FV_LONGLINESLIMIT 8
174 | #define FV_ENCODING 16
175 | #define FV_MODE 32
176 |
177 | typedef struct _filevars {
178 |
179 | int mask;
180 | int iTabWidth;
181 | int iIndentWidth;
182 | BOOL bTabsAsSpaces;
183 | int iLongLinesLimit;
184 | char tchEncoding[32];
185 | int iEncoding;
186 | char tchMode[32];
187 |
188 | } FILEVARS, *LPFILEVARS;
189 |
190 | BOOL FileVars_Init(char*,DWORD,LPFILEVARS);
191 | BOOL FileVars_Apply(HWND,LPFILEVARS);
192 | BOOL FileVars_ParseInt(char*,char*,int*);
193 | BOOL FileVars_ParseStr(char*,char*,char*,int);
194 | BOOL FileVars_IsUTF8(LPFILEVARS);
195 | BOOL FileVars_IsNonUTF8(LPFILEVARS);
196 | BOOL FileVars_IsValidEncoding(LPFILEVARS);
197 | int FileVars_GetEncoding(LPFILEVARS);
198 |
199 |
200 |
201 | /// End of Edit.h \\\
202 |
--------------------------------------------------------------------------------
/src/Helpers.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Helpers.h
7 | * Definitions for general helper functions and macros
8 | *
9 | * See Readme.txt for more information about this source code.
10 | * Please send me your comments to this work.
11 | *
12 | * See License.txt for details about distribution and modification.
13 | *
14 | * (c) Florian Balmer 1996-2010
15 | * florian.balmer@gmail.com
16 | * http://www.flos-freeware.ch
17 | *
18 | *
19 | ******************************************************************************/
20 |
21 |
22 |
23 | extern HINSTANCE g_hInstance;
24 | extern UINT16 g_uWinVer;
25 |
26 |
27 | #define COUNTOF(ar) (sizeof(ar)/sizeof(ar[0]))
28 |
29 |
30 | extern WCHAR szIniFile[MAX_PATH];
31 | #define IniGetString(lpSection,lpName,lpDefault,lpReturnedStr,nSize) \
32 | GetPrivateProfileString(lpSection,lpName,lpDefault,lpReturnedStr,nSize,szIniFile)
33 | #define IniGetInt(lpSection,lpName,nDefault) \
34 | GetPrivateProfileInt(lpSection,lpName,nDefault,szIniFile)
35 | #define IniSetString(lpSection,lpName,lpString) \
36 | WritePrivateProfileString(lpSection,lpName,lpString,szIniFile)
37 | #define IniDeleteSection(lpSection) \
38 | WritePrivateProfileSection(lpSection,NULL,szIniFile)
39 | __inline BOOL IniSetInt(LPCWSTR lpSection,LPCWSTR lpName,int i) {
40 | WCHAR tch[32]; wsprintf(tch,L"%i",i); return IniSetString(lpSection,lpName,tch);
41 | }
42 | #define LoadIniSection(lpSection,lpBuf,cchBuf) \
43 | GetPrivateProfileSection(lpSection,lpBuf,cchBuf,szIniFile);
44 | #define SaveIniSection(lpSection,lpBuf) \
45 | WritePrivateProfileSection(lpSection,lpBuf,szIniFile)
46 | int IniSectionGetString(LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,int);
47 | int IniSectionGetInt(LPCWSTR,LPCWSTR,int);
48 | BOOL IniSectionSetString(LPWSTR,LPCWSTR,LPCWSTR);
49 | __inline BOOL IniSectionSetInt(LPWSTR lpCachedIniSection,LPCWSTR lpName,int i) {
50 | WCHAR tch[32]; wsprintf(tch,L"%i",i); return IniSectionSetString(lpCachedIniSection,lpName,tch);
51 | }
52 |
53 |
54 | void BeginWaitCursor();
55 | void EndWaitCursor();
56 |
57 |
58 | #define Is2k() (g_uWinVer >= 0x0500)
59 | #define IsXP() (g_uWinVer >= 0x0501)
60 | #define IsVista() (g_uWinVer >= 0x0600)
61 | #define IsW7() (g_uWinVer >= 0x0601)
62 |
63 |
64 | BOOL PrivateIsAppThemed();
65 | HRESULT PrivateSetCurrentProcessExplicitAppUserModelID(PCWSTR);
66 | BOOL IsElevated();
67 | //BOOL SetExplorerTheme(HWND);
68 |
69 |
70 | BOOL VerifyContrast();
71 |
72 |
73 | BOOL SetWindowTitle(HWND,UINT,BOOL,UINT,LPCWSTR,int,BOOL,UINT,BOOL,LPCWSTR);
74 | void SetWindowTransparentMode(HWND,BOOL);
75 |
76 |
77 | void CenterDlgInParent(HWND);
78 | void GetDlgPos(HWND,LPINT,LPINT);
79 | void SetDlgPos(HWND,int,int);
80 | void ResizeDlg_Init(HWND,int,int,int);
81 | void ResizeDlg_Destroy(HWND,int*,int*);
82 | void ResizeDlg_Size(HWND,LPARAM,int*,int*);
83 | void ResizeDlg_GetMinMaxInfo(HWND,LPARAM);
84 | HDWP DeferCtlPos(HDWP,HWND,int,int,int,UINT);
85 | void MakeBitmapButton(HWND,int,HINSTANCE,UINT);
86 | void MakeColorPickButton(HWND,int,HINSTANCE,COLORREF);
87 | void DeleteBitmapButton(HWND,int);
88 |
89 |
90 | #define StatusSetSimple(hwnd,b) SendMessage(hwnd,SB_SIMPLE,(WPARAM)b,0)
91 | BOOL StatusSetText(HWND,UINT,LPCWSTR);
92 | BOOL StatusSetTextID(HWND,UINT,UINT);
93 | int StatusCalcPaneWidth(HWND,LPCWSTR);
94 |
95 | int Toolbar_GetButtons(HWND,int,LPWSTR,int);
96 | int Toolbar_SetButtons(HWND,int,LPCWSTR,void*,int);
97 |
98 | LRESULT SendWMSize(HWND);
99 |
100 | #define EnableCmd(hmenu,id,b) EnableMenuItem(hmenu,id,(b)\
101 | ?MF_BYCOMMAND|MF_ENABLED:MF_BYCOMMAND|MF_GRAYED)
102 |
103 | #define CheckCmd(hmenu,id,b) CheckMenuItem(hmenu,id,(b)\
104 | ?MF_BYCOMMAND|MF_CHECKED:MF_BYCOMMAND|MF_UNCHECKED)
105 |
106 | BOOL IsCmdEnabled(HWND, UINT);
107 |
108 |
109 | #define GetString(id,pb,cb) LoadString(g_hInstance,id,pb,cb)
110 |
111 | #define StrEnd(pStart) (pStart + lstrlen(pStart))
112 |
113 | int FormatString(LPWSTR,int,UINT,...);
114 |
115 |
116 | void PathRelativeToApp(LPWSTR,LPWSTR,int,BOOL,BOOL,BOOL);
117 | void PathAbsoluteFromApp(LPWSTR,LPWSTR,int,BOOL);
118 |
119 |
120 | BOOL PathIsLnkFile(LPCWSTR);
121 | BOOL PathGetLnkPath(LPCWSTR,LPWSTR,int);
122 | BOOL PathIsLnkToDirectory(LPCWSTR,LPWSTR,int);
123 | BOOL PathCreateDeskLnk(LPCWSTR);
124 | BOOL PathCreateFavLnk(LPCWSTR,LPCWSTR,LPCWSTR);
125 |
126 |
127 | BOOL TrimString(LPWSTR);
128 | BOOL ExtractFirstArgument(LPCWSTR, LPWSTR, LPWSTR);
129 |
130 | void PrepareFilterStr(LPWSTR);
131 |
132 | void StrTab2Space(LPWSTR);
133 |
134 |
135 | void ExpandEnvironmentStringsEx(LPWSTR,DWORD);
136 | void PathCanonicalizeEx(LPWSTR);
137 | DWORD GetLongPathNameEx(LPCWSTR,LPWSTR,DWORD);
138 | DWORD_PTR SHGetFileInfo2(LPCWSTR,DWORD,SHFILEINFO*,UINT,UINT);
139 |
140 |
141 | int FormatNumberStr(LPWSTR);
142 | BOOL SetDlgItemIntEx(HWND,int,UINT);
143 |
144 |
145 | #define MBCSToWChar(c,a,w,i) MultiByteToWideChar(c,0,a,-1,w,i)
146 | #define WCharToMBCS(c,w,a,i) WideCharToMultiByte(c,0,w,-1,a,i,NULL,NULL)
147 |
148 | UINT GetDlgItemTextA2W(UINT,HWND,int,LPSTR,int);
149 | UINT SetDlgItemTextA2W(UINT,HWND,int,LPSTR);
150 | LRESULT ComboBox_AddStringA2W(UINT,HWND,LPCSTR);
151 |
152 |
153 | UINT CodePageFromCharSet(UINT);
154 |
155 |
156 | //==== MRU Functions ==========================================================
157 | #define MRU_MAXITEMS 24
158 | #define MRU_NOCASE 1
159 | #define MRU_UTF8 2
160 |
161 | typedef struct _mrulist {
162 |
163 | WCHAR szRegKey[256];
164 | int iFlags;
165 | int iSize;
166 | LPWSTR pszItems[MRU_MAXITEMS];
167 |
168 | } MRULIST, *PMRULIST, *LPMRULIST;
169 |
170 | LPMRULIST MRU_Create(LPCWSTR,int,int);
171 | BOOL MRU_Destroy(LPMRULIST);
172 | BOOL MRU_Add(LPMRULIST,LPCWSTR);
173 | BOOL MRU_AddFile(LPMRULIST,LPCWSTR,BOOL,BOOL);
174 | BOOL MRU_Delete(LPMRULIST,int);
175 | BOOL MRU_DeleteFileFromStore(LPMRULIST,LPCWSTR);
176 | BOOL MRU_Empty(LPMRULIST);
177 | int MRU_Enum(LPMRULIST,int,LPWSTR,int);
178 | BOOL MRU_Load(LPMRULIST);
179 | BOOL MRU_Save(LPMRULIST);
180 | BOOL MRU_MergeSave(LPMRULIST,BOOL,BOOL,BOOL);
181 |
182 |
183 | //==== Themed Dialogs =========================================================
184 | #ifndef DLGTEMPLATEEX
185 | #pragma pack(push, 1)
186 | typedef struct {
187 | WORD dlgVer;
188 | WORD signature;
189 | DWORD helpID;
190 | DWORD exStyle;
191 | DWORD style;
192 | WORD cDlgItems;
193 | short x;
194 | short y;
195 | short cx;
196 | short cy;
197 | } DLGTEMPLATEEX;
198 | #pragma pack(pop)
199 | #endif
200 |
201 | BOOL GetThemedDialogFont(LPWSTR,WORD*);
202 | DLGTEMPLATE* LoadThemedDialogTemplate(LPCTSTR,HINSTANCE);
203 | #define ThemedDialogBox(hInstance,lpTemplate,hWndParent,lpDialogFunc) \
204 | ThemedDialogBoxParam(hInstance,lpTemplate,hWndParent,lpDialogFunc,0)
205 | INT_PTR ThemedDialogBoxParam(HINSTANCE,LPCTSTR,HWND,DLGPROC,LPARAM);
206 | HWND CreateThemedDialogParam(HINSTANCE,LPCTSTR,HWND,DLGPROC,LPARAM);
207 |
208 |
209 | //==== UnSlash Functions ======================================================
210 | void TransformBackslashes(char*,BOOL);
211 |
212 |
213 | //==== MinimizeToTray Functions - see comments in Helpers.c ===================
214 | VOID MinimizeWndToTray(HWND hWnd);
215 | VOID RestoreWndFromTray(HWND hWnd);
216 |
217 |
218 |
219 | /// End of Helpers.h \\\
220 |
--------------------------------------------------------------------------------
/src/Notepad2.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/src/Notepad2.c
--------------------------------------------------------------------------------
/src/Notepad2.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Notepad2.h
7 | * Global definitions and declarations
8 | *
9 | * See Readme.txt for more information about this source code.
10 | * Please send me your comments to this work.
11 | *
12 | * See License.txt for details about distribution and modification.
13 | *
14 | * (c) Florian Balmer 1996-2010
15 | * florian.balmer@gmail.com
16 | * http://www.flos-freeware.ch
17 | *
18 | *
19 | ******************************************************************************/
20 |
21 |
22 | //==== Bookmark Edition ============================================================
23 | #define BOOKMARK_EDITION
24 | // Most changes to the source code are within a BOOKMARK_EDITION #ifdef
25 | // Other changes:
26 | // Resources: No #ifdef's since it is a generated file.
27 |
28 |
29 | //==== Main Window ============================================================
30 | #define WC_NOTEPAD2 L"Notepad2"
31 |
32 |
33 | //==== Data Type for WM_COPYDATA ==============================================
34 | #define DATA_NOTEPAD2_PARAMS 0xFB09
35 | typedef struct np2params {
36 |
37 | int flagFileSpecified;
38 | int flagLexerSpecified;
39 | int iInitialLexer;
40 | int flagQuietCreate;
41 | int flagJumpTo;
42 | int iInitialLine;
43 | int iInitialColumn;
44 | int iSrcEncoding;
45 | int flagSetEncoding;
46 | int flagSetEOLMode;
47 | int flagTitleExcerpt;
48 | WCHAR wchData;
49 |
50 | } NP2PARAMS, *LPNP2PARAMS;
51 |
52 |
53 | //==== Toolbar Style ==========================================================
54 | #define WS_TOOLBAR (WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | \
55 | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | TBSTYLE_ALTDRAG | \
56 | TBSTYLE_LIST | CCS_NODIVIDER | CCS_NOPARENTALIGN | \
57 | CCS_ADJUSTABLE)
58 |
59 |
60 | //==== ReBar Style ============================================================
61 | #define WS_REBAR (WS_CHILD | WS_CLIPCHILDREN | WS_BORDER | RBS_VARHEIGHT | \
62 | RBS_BANDBORDERS | CCS_NODIVIDER | CCS_NOPARENTALIGN)
63 |
64 |
65 | //==== Ids ====================================================================
66 | #define IDC_STATUSBAR 0xFB00
67 | #define IDC_TOOLBAR 0xFB01
68 | #define IDC_REBAR 0xFB02
69 | #define IDC_EDIT 0xFB03
70 | #define IDC_EDITFRAME 0xFB04
71 | #define IDC_FILENAME 0xFB05
72 | #define IDC_REUSELOCK 0xFB06
73 |
74 |
75 | //==== Statusbar ==============================================================
76 | #define STATUS_DOCPOS 0
77 | #define STATUS_DOCSIZE 1
78 | #define STATUS_CODEPAGE 2
79 | #define STATUS_EOLMODE 3
80 | #define STATUS_OVRMODE 4
81 | #define STATUS_LEXER 5
82 | #define STATUS_HELP 255
83 |
84 |
85 | //==== Change Notifications ===================================================
86 | #define ID_WATCHTIMER 0xA000
87 | #define WM_CHANGENOTIFY WM_USER+1
88 | //#define WM_CHANGENOTIFYCLEAR WM_USER+2
89 |
90 |
91 | //==== Callback Message from System Tray ======================================
92 | #define WM_TRAYMESSAGE WM_USER
93 |
94 |
95 | //==== Paste Board Timer ======================================================
96 | #define ID_PASTEBOARDTIMER 0xA001
97 |
98 |
99 | //==== Reuse Window Lock Timeout ==============================================
100 | #define REUSEWINDOWLOCKTIMEOUT 1000
101 |
102 |
103 | //==== Function Declarations ==================================================
104 | BOOL InitApplication(HINSTANCE);
105 | HWND InitInstance(HINSTANCE,LPSTR,int);
106 | BOOL ActivatePrevInst();
107 | BOOL RelaunchMultiInst();
108 | BOOL RelaunchElevated();
109 | void ShowNotifyIcon(HWND,BOOL);
110 | void SetNotifyIconTitle(HWND);
111 | void InstallFileWatching(LPCWSTR);
112 | void CALLBACK WatchTimerProc(HWND,UINT,UINT_PTR,DWORD);
113 | void CALLBACK PasteBoardTimer(HWND,UINT,UINT_PTR,DWORD);
114 |
115 |
116 | void LoadSettings();
117 | void SaveSettings(BOOL);
118 | void ParseCommandLine();
119 | void LoadFlags();
120 | int CheckIniFile(LPWSTR,LPCWSTR);
121 | int CheckIniFileRedirect(LPWSTR,LPCWSTR);
122 | int FindIniFile();
123 | int TestIniFile();
124 | int CreateIniFile();
125 | int CreateIniFileEx(LPCWSTR);
126 |
127 |
128 | void UpdateStatusbar();
129 | void UpdateToolbar();
130 | void UpdateLineNumberWidth();
131 |
132 |
133 | BOOL FileIO(BOOL,LPCWSTR,BOOL,int*,int*,BOOL*,BOOL*,BOOL*,BOOL);
134 | BOOL FileLoad(BOOL,BOOL,BOOL,BOOL,LPCWSTR);
135 | BOOL FileSave(BOOL,BOOL,BOOL,BOOL);
136 | BOOL OpenFileDlg(HWND,LPWSTR,int,LPCWSTR);
137 | BOOL SaveFileDlg(HWND,LPWSTR,int,LPCWSTR);
138 |
139 |
140 | LRESULT CALLBACK MainWndProc(HWND,UINT,WPARAM,LPARAM);
141 | LRESULT MsgCreate(HWND,WPARAM,LPARAM);
142 | void CreateBars(HWND,HINSTANCE);
143 | void MsgThemeChanged(HWND,WPARAM,LPARAM);
144 | void MsgSize(HWND,WPARAM,LPARAM);
145 | void MsgInitMenu(HWND,WPARAM,LPARAM);
146 | LRESULT MsgCommand(HWND,WPARAM,LPARAM);
147 | LRESULT MsgNotify(HWND,WPARAM,LPARAM);
148 |
149 |
150 |
151 | /// End of Notepad2.h \\\
152 |
--------------------------------------------------------------------------------
/src/Notepad2.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/djs/notepad2/2161db52b51172b47694f10ebb6b24d6fdceeb21/src/Notepad2.rc
--------------------------------------------------------------------------------
/src/Print.cpp:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Print.cpp
7 | * Scintilla Printing Functionality
8 | * Mostly taken from SciTE, (c) Neil Hodgson, http://www.scintilla.org
9 | *
10 | * See Readme.txt for more information about this source code.
11 | * Please send me your comments to this work.
12 | *
13 | * See License.txt for details about distribution and modification.
14 | *
15 | * (c) Florian Balmer 1996-2010
16 | * florian.balmer@gmail.com
17 | * http://www.flos-freeware.ch
18 | *
19 | *
20 | ******************************************************************************/
21 | #define _WIN32_WINNT 0x501
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include "platform.h"
28 | #include "scintilla.h"
29 | #include "scilexer.h"
30 | extern "C" {
31 | #include "dialogs.h"
32 | #include "helpers.h"
33 | #include "scicall.h"
34 | }
35 | #include "resource.h"
36 |
37 |
38 | extern "C" HINSTANCE g_hInstance;
39 |
40 |
41 | // Global settings...
42 | extern "C" int iPrintHeader;
43 | extern "C" int iPrintFooter;
44 | extern "C" int iPrintColor;
45 | extern "C" int iPrintZoom;
46 | extern "C" RECT pagesetupMargin;
47 |
48 |
49 | // Stored objects...
50 | HGLOBAL hDevMode = NULL;
51 | HGLOBAL hDevNames = NULL;
52 |
53 |
54 | //=============================================================================
55 | //
56 | // EditPrint() - Code from SciTE
57 | //
58 | extern "C" HWND hwndStatus;
59 |
60 | void StatusUpdatePrintPage(int iPageNum)
61 | {
62 | WCHAR tch[32];
63 |
64 | FormatString(tch,COUNTOF(tch),IDS_PRINTFILE,iPageNum);
65 |
66 | StatusSetText(hwndStatus,255,tch);
67 | StatusSetSimple(hwndStatus,TRUE);
68 |
69 | InvalidateRect(hwndStatus,NULL,TRUE);
70 | UpdateWindow(hwndStatus);
71 | }
72 |
73 |
74 | extern "C" BOOL EditPrint(HWND hwnd,LPCWSTR pszDocTitle,LPCWSTR pszPageFormat)
75 | {
76 |
77 | // Don't print empty documents
78 | if (SendMessage(hwnd,SCI_GETLENGTH,0,0) == 0) {
79 | MsgBox(MBINFO,IDS_PRINT_EMPTY);
80 | return TRUE;
81 | }
82 |
83 | int startPos;
84 | int endPos;
85 |
86 | HDC hdc;
87 |
88 | RECT rectMargins;
89 | RECT rectPhysMargins;
90 | RECT rectSetup;
91 | POINT ptPage;
92 | POINT ptDpi;
93 |
94 | //RECT rectSetup;
95 |
96 | TEXTMETRIC tm;
97 |
98 | int headerLineHeight;
99 | HFONT fontHeader;
100 |
101 | int footerLineHeight;
102 | HFONT fontFooter;
103 |
104 | WCHAR dateString[256];
105 |
106 | DOCINFO di = {sizeof(DOCINFO), 0, 0, 0, 0};
107 |
108 | LONG lengthDoc;
109 | LONG lengthDocMax;
110 | LONG lengthPrinted;
111 |
112 | struct RangeToFormat frPrint;
113 |
114 | int pageNum;
115 | BOOL printPage;
116 |
117 | WCHAR pageString[32];
118 |
119 | HPEN pen;
120 | HPEN penOld;
121 |
122 | PRINTDLG pdlg = { sizeof(PRINTDLG), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
123 | pdlg.hwndOwner = GetParent(hwnd);
124 | pdlg.hInstance = g_hInstance;
125 | pdlg.Flags = PD_USEDEVMODECOPIES | PD_ALLPAGES | PD_RETURNDC;
126 | pdlg.nFromPage = 1;
127 | pdlg.nToPage = 1;
128 | pdlg.nMinPage = 1;
129 | pdlg.nMaxPage = 0xffffU;
130 | pdlg.nCopies = 1;
131 | pdlg.hDC = 0;
132 | pdlg.hDevMode = hDevMode;
133 | pdlg.hDevNames = hDevNames;
134 |
135 | startPos = SendMessage(hwnd,SCI_GETSELECTIONSTART,0,0);;
136 | endPos = SendMessage(hwnd,SCI_GETSELECTIONEND,0,0);
137 |
138 | if (startPos == endPos) {
139 | pdlg.Flags |= PD_NOSELECTION;
140 | } else {
141 | pdlg.Flags |= PD_SELECTION;
142 | }
143 | if (0) {
144 | // Don't display dialog box, just use the default printer and options
145 | pdlg.Flags |= PD_RETURNDEFAULT;
146 | }
147 | if (!PrintDlg(&pdlg)) {
148 | return TRUE; // False means error...
149 | }
150 |
151 | hDevMode = pdlg.hDevMode;
152 | hDevNames = pdlg.hDevNames;
153 |
154 | hdc = pdlg.hDC;
155 |
156 | // Get printer resolution
157 | ptDpi.x = GetDeviceCaps(hdc, LOGPIXELSX); // dpi in X direction
158 | ptDpi.y = GetDeviceCaps(hdc, LOGPIXELSY); // dpi in Y direction
159 |
160 | // Start by getting the physical page size (in device units).
161 | ptPage.x = GetDeviceCaps(hdc, PHYSICALWIDTH); // device units
162 | ptPage.y = GetDeviceCaps(hdc, PHYSICALHEIGHT); // device units
163 |
164 | // Get the dimensions of the unprintable
165 | // part of the page (in device units).
166 | rectPhysMargins.left = GetDeviceCaps(hdc, PHYSICALOFFSETX);
167 | rectPhysMargins.top = GetDeviceCaps(hdc, PHYSICALOFFSETY);
168 |
169 | // To get the right and lower unprintable area,
170 | // we take the entire width and height of the paper and
171 | // subtract everything else.
172 | rectPhysMargins.right = ptPage.x // total paper width
173 | - GetDeviceCaps(hdc, HORZRES) // printable width
174 | - rectPhysMargins.left; // left unprintable margin
175 |
176 | rectPhysMargins.bottom = ptPage.y // total paper height
177 | - GetDeviceCaps(hdc, VERTRES) // printable height
178 | - rectPhysMargins.top; // right unprintable margin
179 |
180 | // At this point, rectPhysMargins contains the widths of the
181 | // unprintable regions on all four sides of the page in device units.
182 |
183 | // Take in account the page setup given by the user (if one value is not null)
184 | if (pagesetupMargin.left != 0 || pagesetupMargin.right != 0 ||
185 | pagesetupMargin.top != 0 || pagesetupMargin.bottom != 0) {
186 |
187 | // Convert the hundredths of millimeters (HiMetric) or
188 | // thousandths of inches (HiEnglish) margin values
189 | // from the Page Setup dialog to device units.
190 | // (There are 2540 hundredths of a mm in an inch.)
191 |
192 | WCHAR localeInfo[3];
193 | GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, localeInfo, 3);
194 |
195 | if (localeInfo[0] == L'0') { // Metric system. L'1' is US System
196 | rectSetup.left = MulDiv (pagesetupMargin.left, ptDpi.x, 2540);
197 | rectSetup.top = MulDiv (pagesetupMargin.top, ptDpi.y, 2540);
198 | rectSetup.right = MulDiv(pagesetupMargin.right, ptDpi.x, 2540);
199 | rectSetup.bottom = MulDiv(pagesetupMargin.bottom, ptDpi.y, 2540);
200 | } else {
201 | rectSetup.left = MulDiv(pagesetupMargin.left, ptDpi.x, 1000);
202 | rectSetup.top = MulDiv(pagesetupMargin.top, ptDpi.y, 1000);
203 | rectSetup.right = MulDiv(pagesetupMargin.right, ptDpi.x, 1000);
204 | rectSetup.bottom = MulDiv(pagesetupMargin.bottom, ptDpi.y, 1000);
205 | }
206 |
207 | // Dont reduce margins below the minimum printable area
208 | rectMargins.left = max(rectPhysMargins.left, rectSetup.left);
209 | rectMargins.top = max(rectPhysMargins.top, rectSetup.top);
210 | rectMargins.right = max(rectPhysMargins.right, rectSetup.right);
211 | rectMargins.bottom = max(rectPhysMargins.bottom, rectSetup.bottom);
212 | } else {
213 | rectMargins.left = rectPhysMargins.left;
214 | rectMargins.top = rectPhysMargins.top;
215 | rectMargins.right = rectPhysMargins.right;
216 | rectMargins.bottom = rectPhysMargins.bottom;
217 | }
218 |
219 | // rectMargins now contains the values used to shrink the printable
220 | // area of the page.
221 |
222 | // Convert device coordinates into logical coordinates
223 | DPtoLP(hdc, (LPPOINT)&rectMargins, 2);
224 | DPtoLP(hdc, (LPPOINT)&rectPhysMargins, 2);
225 |
226 | // Convert page size to logical units and we're done!
227 | DPtoLP(hdc, (LPPOINT) &ptPage, 1);
228 |
229 | headerLineHeight = MulDiv(8,ptDpi.y, 72);
230 | fontHeader = CreateFont(headerLineHeight,
231 | 0, 0, 0,
232 | FW_BOLD,
233 | 0,
234 | 0,
235 | 0, 0, 0,
236 | 0, 0, 0,
237 | L"Arial");
238 | SelectObject(hdc, fontHeader);
239 | GetTextMetrics(hdc, &tm);
240 | headerLineHeight = tm.tmHeight + tm.tmExternalLeading;
241 |
242 | if (iPrintHeader == 3)
243 | headerLineHeight = 0;
244 |
245 | footerLineHeight = MulDiv(7,ptDpi.y, 72);
246 | fontFooter = CreateFont(footerLineHeight,
247 | 0, 0, 0,
248 | FW_NORMAL,
249 | 0,
250 | 0,
251 | 0, 0, 0,
252 | 0, 0, 0,
253 | L"Arial");
254 | SelectObject(hdc, fontFooter);
255 | GetTextMetrics(hdc, &tm);
256 | footerLineHeight = tm.tmHeight + tm.tmExternalLeading;
257 |
258 | if (iPrintFooter == 1)
259 | footerLineHeight = 0;
260 |
261 | di.lpszDocName = pszDocTitle;
262 | di.lpszOutput = 0;
263 | di.lpszDatatype = 0;
264 | di.fwType = 0;
265 | if (StartDoc(hdc, &di) < 0) {
266 | DeleteDC(hdc);
267 | if (fontHeader)
268 | DeleteObject(fontHeader);
269 | if (fontFooter)
270 | DeleteObject(fontFooter);
271 | return FALSE;
272 | }
273 |
274 | // Get current date...
275 | SYSTEMTIME st;
276 | GetLocalTime(&st);
277 | GetDateFormat(LOCALE_USER_DEFAULT,DATE_SHORTDATE,&st,NULL,dateString,256);
278 |
279 | // Get current time...
280 | if (iPrintHeader == 0)
281 | {
282 | WCHAR timeString[128];
283 | GetTimeFormat(LOCALE_USER_DEFAULT,TIME_NOSECONDS,&st,NULL,timeString,128);
284 | lstrcat(dateString,L" ");
285 | lstrcat(dateString,timeString);
286 | }
287 |
288 | // Set print color mode
289 | int printColorModes[5] = {
290 | SC_PRINT_NORMAL,
291 | SC_PRINT_INVERTLIGHT,
292 | SC_PRINT_BLACKONWHITE,
293 | SC_PRINT_COLOURONWHITE,
294 | SC_PRINT_COLOURONWHITEDEFAULTBG };
295 | SendMessage(hwnd,SCI_SETPRINTCOLOURMODE,printColorModes[iPrintColor],0);
296 |
297 | // Set print zoom...
298 | SendMessage(hwnd,SCI_SETPRINTMAGNIFICATION,(WPARAM)iPrintZoom,0);
299 |
300 | lengthDoc = SendMessage(hwnd,SCI_GETLENGTH,0,0);
301 | lengthDocMax = lengthDoc;
302 | lengthPrinted = 0;
303 |
304 | // Requested to print selection
305 | if (pdlg.Flags & PD_SELECTION) {
306 | if (startPos > endPos) {
307 | lengthPrinted = endPos;
308 | lengthDoc = startPos;
309 | } else {
310 | lengthPrinted = startPos;
311 | lengthDoc = endPos;
312 | }
313 |
314 | if (lengthPrinted < 0)
315 | lengthPrinted = 0;
316 | if (lengthDoc > lengthDocMax)
317 | lengthDoc = lengthDocMax;
318 | }
319 |
320 | // We must substract the physical margins from the printable area
321 | frPrint.hdc = hdc;
322 | frPrint.hdcTarget = hdc;
323 | frPrint.rc.left = rectMargins.left - rectPhysMargins.left;
324 | frPrint.rc.top = rectMargins.top - rectPhysMargins.top;
325 | frPrint.rc.right = ptPage.x - rectMargins.right - rectPhysMargins.left;
326 | frPrint.rc.bottom = ptPage.y - rectMargins.bottom - rectPhysMargins.top;
327 | frPrint.rcPage.left = 0;
328 | frPrint.rcPage.top = 0;
329 | frPrint.rcPage.right = ptPage.x - rectPhysMargins.left - rectPhysMargins.right - 1;
330 | frPrint.rcPage.bottom = ptPage.y - rectPhysMargins.top - rectPhysMargins.bottom - 1;
331 | frPrint.rc.top += headerLineHeight + headerLineHeight / 2;
332 | frPrint.rc.bottom -= footerLineHeight + footerLineHeight / 2;
333 | // Print each page
334 | pageNum = 1;
335 |
336 | while (lengthPrinted < lengthDoc) {
337 | printPage = (!(pdlg.Flags & PD_PAGENUMS) ||
338 | (pageNum >= pdlg.nFromPage) && (pageNum <= pdlg.nToPage));
339 |
340 | wsprintf(pageString, pszPageFormat, pageNum);
341 |
342 | if (printPage) {
343 |
344 | // Show wait cursor...
345 | SendMessage(hwnd,SCI_SETCURSOR,SC_CURSORWAIT,0);
346 |
347 | // Display current page number in Statusbar
348 | StatusUpdatePrintPage(pageNum);
349 |
350 | StartPage(hdc);
351 |
352 | SetTextColor(hdc, RGB(0,0,0));
353 | SetBkColor(hdc, RGB(255,255,255));
354 | SelectObject(hdc, fontHeader);
355 | UINT ta = SetTextAlign(hdc, TA_BOTTOM);
356 | RECT rcw = {frPrint.rc.left, frPrint.rc.top - headerLineHeight - headerLineHeight / 2,
357 | frPrint.rc.right, frPrint.rc.top - headerLineHeight / 2};
358 | rcw.bottom = rcw.top + headerLineHeight;
359 |
360 | if (iPrintHeader < 3)
361 | {
362 | ExtTextOut(hdc, frPrint.rc.left + 5, frPrint.rc.top - headerLineHeight / 2,
363 | /*ETO_OPAQUE*/0, &rcw, pszDocTitle,
364 | lstrlen(pszDocTitle), NULL);
365 | }
366 |
367 | // Print date in header
368 | if (iPrintHeader == 0 || iPrintHeader == 1)
369 | {
370 | SIZE sizeInfo;
371 | SelectObject(hdc,fontFooter);
372 | GetTextExtentPoint32(hdc,dateString,lstrlen(dateString),&sizeInfo);
373 | ExtTextOut(hdc, frPrint.rc.right - 5 - sizeInfo.cx, frPrint.rc.top - headerLineHeight / 2,
374 | /*ETO_OPAQUE*/0, &rcw, dateString,
375 | lstrlen(dateString), NULL);
376 | }
377 |
378 | if (iPrintHeader < 3)
379 | {
380 | SetTextAlign(hdc, ta);
381 | pen = CreatePen(0, 1, RGB(0,0,0));
382 | penOld = (HPEN)SelectObject(hdc, pen);
383 | MoveToEx(hdc, frPrint.rc.left, frPrint.rc.top - headerLineHeight / 4, NULL);
384 | LineTo(hdc, frPrint.rc.right, frPrint.rc.top - headerLineHeight / 4);
385 | SelectObject(hdc, penOld);
386 | DeleteObject(pen);
387 | }
388 | }
389 |
390 | frPrint.chrg.cpMin = lengthPrinted;
391 | frPrint.chrg.cpMax = lengthDoc;
392 |
393 | lengthPrinted = SendMessage(hwnd,SCI_FORMATRANGE,printPage,(LPARAM)&frPrint);
394 |
395 | if (printPage) {
396 | SetTextColor(hdc, RGB(0,0,0));
397 | SetBkColor(hdc, RGB(255,255,255));
398 | SelectObject(hdc, fontFooter);
399 | UINT ta = SetTextAlign(hdc, TA_TOP);
400 | RECT rcw = {frPrint.rc.left, frPrint.rc.bottom + footerLineHeight / 2,
401 | frPrint.rc.right, frPrint.rc.bottom + footerLineHeight + footerLineHeight / 2};
402 |
403 | if (iPrintFooter == 0)
404 | {
405 | SIZE sizeFooter;
406 | GetTextExtentPoint32(hdc,pageString,lstrlen(pageString),&sizeFooter);
407 | ExtTextOut(hdc, frPrint.rc.right - 5 - sizeFooter.cx, frPrint.rc.bottom + footerLineHeight / 2,
408 | /*ETO_OPAQUE*/0, &rcw, pageString,
409 | lstrlen(pageString), NULL);
410 |
411 | SetTextAlign(hdc, ta);
412 | pen = ::CreatePen(0, 1, RGB(0,0,0));
413 | penOld = (HPEN)SelectObject(hdc, pen);
414 | SetBkColor(hdc, RGB(0,0,0));
415 | MoveToEx(hdc, frPrint.rc.left, frPrint.rc.bottom + footerLineHeight / 4, NULL);
416 | LineTo(hdc, frPrint.rc.right, frPrint.rc.bottom + footerLineHeight / 4);
417 | SelectObject(hdc, penOld);
418 | DeleteObject(pen);
419 | }
420 |
421 | EndPage(hdc);
422 | }
423 | pageNum++;
424 |
425 | if ((pdlg.Flags & PD_PAGENUMS) && (pageNum > pdlg.nToPage))
426 | break;
427 | }
428 |
429 | SendMessage(hwnd,SCI_FORMATRANGE, FALSE, 0);
430 |
431 | EndDoc(hdc);
432 | DeleteDC(hdc);
433 | if (fontHeader)
434 | DeleteObject(fontHeader);
435 | if (fontFooter)
436 | DeleteObject(fontFooter);
437 |
438 | // Reset Statusbar to default mode
439 | StatusSetSimple(hwndStatus,FALSE);
440 |
441 | // Remove wait cursor...
442 | SendMessage(hwnd,SCI_SETCURSOR,SC_CURSORNORMAL,0);
443 |
444 | return TRUE;
445 | }
446 |
447 |
448 | //=============================================================================
449 | //
450 | // EditPrintSetup() - Code from SciTE
451 | //
452 | // Custom controls: 30 Zoom
453 | // 31 Spin
454 | // 32 Header
455 | // 33 Footer
456 | // 34 Colors
457 | //
458 | extern "C" UINT_PTR CALLBACK PageSetupHook(HWND hwnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
459 | {
460 | switch (uiMsg)
461 | {
462 | case WM_INITDIALOG:
463 | {
464 | WCHAR tch[512];
465 | WCHAR *p1,*p2;
466 |
467 | SendDlgItemMessage(hwnd,30,EM_LIMITTEXT,32,0);
468 |
469 | SendDlgItemMessage(hwnd,31,UDM_SETRANGE,0,MAKELONG((short)20,(short)-10));
470 | SendDlgItemMessage(hwnd,31,UDM_SETPOS,0,MAKELONG((short)iPrintZoom,0));
471 |
472 | // Set header options
473 | GetString(IDS_PRINT_HEADER,tch,COUNTOF(tch));
474 | lstrcat(tch,L"|");
475 | p1 = tch;
476 | while (p2 = StrChr(p1,L'|')) {
477 | *p2++ = L'\0';
478 | if (*p1)
479 | SendDlgItemMessage(hwnd,32,CB_ADDSTRING,0,(LPARAM)p1);
480 | p1 = p2; }
481 | SendDlgItemMessage(hwnd,32,CB_SETCURSEL,(WPARAM)iPrintHeader,0);
482 |
483 | // Set footer options
484 | GetString(IDS_PRINT_FOOTER,tch,COUNTOF(tch));
485 | lstrcat(tch,L"|");
486 | p1 = tch;
487 | while (p2 = StrChr(p1,L'|')) {
488 | *p2++ = L'\0';
489 | if (*p1)
490 | SendDlgItemMessage(hwnd,33,CB_ADDSTRING,0,(LPARAM)p1);
491 | p1 = p2; }
492 | SendDlgItemMessage(hwnd,33,CB_SETCURSEL,(WPARAM)iPrintFooter,0);
493 |
494 | // Set color options
495 | GetString(IDS_PRINT_COLOR,tch,COUNTOF(tch));
496 | lstrcat(tch,L"|");
497 | p1 = tch;
498 | while (p2 = StrChr(p1,L'|')) {
499 | *p2++ = L'\0';
500 | if (*p1)
501 | SendDlgItemMessage(hwnd,34,CB_ADDSTRING,0,(LPARAM)p1);
502 | p1 = p2; }
503 | SendDlgItemMessage(hwnd,34,CB_SETCURSEL,(WPARAM)iPrintColor,0);
504 |
505 | // Make combos handier
506 | SendDlgItemMessage(hwnd,32,CB_SETEXTENDEDUI,TRUE,0);
507 | SendDlgItemMessage(hwnd,33,CB_SETEXTENDEDUI,TRUE,0);
508 | SendDlgItemMessage(hwnd,34,CB_SETEXTENDEDUI,TRUE,0);
509 | SendDlgItemMessage(hwnd,1137,CB_SETEXTENDEDUI,TRUE,0);
510 | SendDlgItemMessage(hwnd,1138,CB_SETEXTENDEDUI,TRUE,0);
511 | }
512 | break;
513 |
514 | case WM_COMMAND:
515 | if (LOWORD(wParam) == IDOK)
516 | {
517 | LONG lPos = SendDlgItemMessage(hwnd,31,UDM_GETPOS,0,0);
518 | if (HIWORD(lPos) == 0)
519 | iPrintZoom = (int)(short)LOWORD(lPos);
520 | else
521 | iPrintZoom = 0;
522 |
523 | iPrintHeader = SendDlgItemMessage(hwnd,32,CB_GETCURSEL,0,0);
524 | iPrintFooter = SendDlgItemMessage(hwnd,33,CB_GETCURSEL,0,0);
525 | iPrintColor = SendDlgItemMessage(hwnd,34,CB_GETCURSEL,0,0);
526 | }
527 | break;
528 |
529 | default:
530 | break;
531 | }
532 | return(0);
533 | }
534 |
535 |
536 | extern "C" void EditPrintSetup(HWND hwnd)
537 | {
538 | DLGTEMPLATE* pDlgTemplate =
539 | LoadThemedDialogTemplate(MAKEINTRESOURCE(IDD_PAGESETUP),g_hInstance);
540 |
541 | PAGESETUPDLG pdlg;
542 | ZeroMemory(&pdlg,sizeof(PAGESETUPDLG));
543 | pdlg.lStructSize = sizeof(PAGESETUPDLG);
544 | pdlg.Flags = PSD_ENABLEPAGESETUPHOOK | PSD_ENABLEPAGESETUPTEMPLATEHANDLE;
545 | pdlg.lpfnPageSetupHook = PageSetupHook;
546 | pdlg.hPageSetupTemplate = pDlgTemplate;
547 | pdlg.hwndOwner = GetParent(hwnd);
548 | pdlg.hInstance = g_hInstance;
549 |
550 | if (pagesetupMargin.left != 0 || pagesetupMargin.right != 0 ||
551 | pagesetupMargin.top != 0 || pagesetupMargin.bottom != 0) {
552 | pdlg.Flags |= PSD_MARGINS;
553 |
554 | pdlg.rtMargin.left = pagesetupMargin.left;
555 | pdlg.rtMargin.top = pagesetupMargin.top;
556 | pdlg.rtMargin.right = pagesetupMargin.right;
557 | pdlg.rtMargin.bottom = pagesetupMargin.bottom;
558 | }
559 |
560 | pdlg.hDevMode = hDevMode;
561 | pdlg.hDevNames = hDevNames;
562 |
563 | if (PageSetupDlg(&pdlg)) {
564 |
565 | pagesetupMargin.left = pdlg.rtMargin.left;
566 | pagesetupMargin.top = pdlg.rtMargin.top;
567 | pagesetupMargin.right = pdlg.rtMargin.right;
568 | pagesetupMargin.bottom = pdlg.rtMargin.bottom;
569 |
570 | hDevMode = pdlg.hDevMode;
571 | hDevNames = pdlg.hDevNames;
572 | }
573 |
574 | LocalFree(pDlgTemplate);
575 | }
576 |
577 |
578 | //=============================================================================
579 | //
580 | // EditPrintInit() - Setup default page margin if no values from registry
581 | //
582 | extern "C" void EditPrintInit()
583 | {
584 | if (pagesetupMargin.left == -1 || pagesetupMargin.top == -1 ||
585 | pagesetupMargin.right == -1 || pagesetupMargin.bottom == -1)
586 | {
587 | WCHAR localeInfo[3];
588 | GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, localeInfo, 3);
589 |
590 | if (localeInfo[0] == L'0') { // Metric system. L'1' is US System
591 | pagesetupMargin.left = 2000;
592 | pagesetupMargin.top = 2000;
593 | pagesetupMargin.right = 2000;
594 | pagesetupMargin.bottom = 2000; }
595 |
596 | else {
597 | pagesetupMargin.left = 1000;
598 | pagesetupMargin.top = 1000;
599 | pagesetupMargin.right = 1000;
600 | pagesetupMargin.bottom = 1000; }
601 | }
602 | }
603 |
604 |
605 | // End of Print.cpp
606 |
--------------------------------------------------------------------------------
/src/Styles.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * Styles.h
7 | * Scintilla Style Management
8 | *
9 | * See Readme.txt for more information about this source code.
10 | * Please send me your comments to this work.
11 | *
12 | * See License.txt for details about distribution and modification.
13 | *
14 | * (c) Florian Balmer 1996-2010
15 | * florian.balmer@gmail.com
16 | * http://www.flos-freeware.ch
17 | *
18 | *
19 | ******************************************************************************/
20 |
21 |
22 | typedef struct _editstyle
23 | {
24 | union
25 | {
26 | INT32 iStyle;
27 | UINT8 iStyle8[4];
28 | };
29 | int rid;
30 | WCHAR* pszName;
31 | WCHAR* pszDefault;
32 | WCHAR szValue[128];
33 |
34 | } EDITSTYLE, *PEDITSTYLE;
35 |
36 |
37 | typedef struct _keywordlist
38 | {
39 | char *pszKeyWords[9];
40 |
41 | } KEYWORDLIST, *PKEYWORDLIST;
42 |
43 |
44 | typedef struct _editlexer
45 | {
46 | int iLexer;
47 | int rid;
48 | WCHAR* pszName;
49 | WCHAR* pszDefExt;
50 | WCHAR szExtensions[128];
51 | PKEYWORDLIST pKeyWords;
52 | EDITSTYLE Styles[];
53 |
54 | } EDITLEXER, *PEDITLEXER;
55 |
56 |
57 | // Number of Lexers in pLexArray
58 | #define NUMLEXERS 22
59 |
60 |
61 | void Style_Load();
62 | void Style_Save();
63 | BOOL Style_Import(HWND);
64 | BOOL Style_Export(HWND);
65 | void Style_SetLexer(HWND,PEDITLEXER);
66 | void Style_SetLongLineColors(HWND);
67 | void Style_SetCurrentLineBackground(HWND);
68 | void Style_SetLexerFromFile(HWND,LPCWSTR);
69 | void Style_SetLexerFromName(HWND,LPCWSTR,LPCWSTR);
70 | void Style_SetDefaultLexer(HWND);
71 | void Style_SetHTMLLexer(HWND);
72 | void Style_SetXMLLexer(HWND);
73 | void Style_SetLexerFromID(HWND,int);
74 | void Style_SetDefaultFont(HWND);
75 | void Style_ToggleUse2ndDefault(HWND);
76 | BOOL Style_GetUse2ndDefault(HWND);
77 | void Style_SetIndentGuides(HWND,BOOL);
78 | BOOL Style_GetOpenDlgFilterStr(LPWSTR,int);
79 | BOOL Style_StrGetFont(LPCWSTR,LPWSTR,int);
80 | BOOL Style_StrGetFontQuality(LPCWSTR,LPWSTR,int);
81 | BOOL Style_StrGetCharSet(LPCWSTR,int*);
82 | BOOL Style_StrGetSize(LPCWSTR,int*);
83 | BOOL Style_StrGetSizeStr(LPCWSTR,LPWSTR,int);
84 | BOOL Style_StrGetColor(BOOL,LPCWSTR,int*);
85 | BOOL Style_StrGetCase(LPCWSTR,int*);
86 | BOOL Style_StrGetAlpha(LPCWSTR,int*);
87 | BOOL Style_SelectFont(HWND,LPWSTR,int,BOOL);
88 | BOOL Style_SelectColor(HWND,BOOL,LPWSTR,int);
89 | void Style_SetStyles(HWND,int,LPCWSTR);
90 | void Style_SetFontQuality(HWND,LPCWSTR);
91 | void Style_GetCurrentLexerName(LPWSTR,int);
92 | int Style_GetLexerIconId(PEDITLEXER);
93 | void Style_AddLexerToTreeView(HWND,PEDITLEXER);
94 | BOOL CALLBACK Styles_ConfigDlgProc(HWND,UINT,WPARAM,LPARAM);
95 | void Style_ConfigDlg(HWND);
96 | BOOL CALLBACK Style_SelectLexerDlgProc(HWND,UINT,WPARAM,LPARAM);
97 | void Style_SelectLexerDlg(HWND);
98 |
99 |
100 | // End of Style.h
101 |
--------------------------------------------------------------------------------
/src/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Notepad2.rc
4 | //
5 | #define IDR_RT_MANIFEST 1
6 | #define IDR_MAINWND 100
7 | #define IDC_FINDTEXT 100
8 | #define IDC_LINENUM 100
9 | #define IDC_COMMANDLINE 100
10 | #define IDD_ABOUT 100
11 | #define IDC_VERSION 100
12 | #define IDC_OPENWITHDIR 100
13 | #define IDC_FILEMRU 100
14 | #define IDC_STYLELIST 100
15 | #define IDC_FAVORITESDIR 100
16 | #define IDC_COLUMNWRAP 100
17 | #define IDC_INFOBOXICON 100
18 | #define IDC_COPY 100
19 | #define IDC_ENCODINGLIST 100
20 | #define IDC_SEARCHEXE 101
21 | #define IDR_POPUPMENU 101
22 | #define IDC_GETOPENWITHDIR 101
23 | #define IDC_RESIZEGRIP 101
24 | #define IDD_OPENWITH 101
25 | #define IDC_REPLACETEXT 101
26 | #define IDI_RUN 101
27 | #define IDC_COLNUM 101
28 | #define IDC_DEFAULTSCHEME 101
29 | #define IDC_GETFAVORITESDIR 101
30 | #define IDC_INFOBOXTEXT 101
31 | #define IDB_OPEN 101
32 | #define IDR_ACCFINDREPLACE 101
33 | #define IDC_STYLELABEL 101
34 | #define IDC_WEBPAGE 101
35 | #define IDC_RESIZEGRIP4 101
36 | #define IDC_NOUNICODEDETECTION 101
37 | #define IDC_EMAIL 102
38 | #define IDC_STYLEEDIT 102
39 | #define IDC_FINDCASE 102
40 | #define IDC_OPENWITHDESCR 102
41 | #define IDC_SAVEMRU 102
42 | #define IDD_RUN 102
43 | #define IDC_AUTOSELECT 102
44 | #define IDC_FAVORITESDESCR 102
45 | #define IDC_INFOBOXCHECK 102
46 | #define IDC_CONSISTENTEOLS 102
47 | #define IDB_PREV 102
48 | #define IDI_STYLES 102
49 | #define IDC_ASCIIASUTF8 102
50 | #define IDC_WEBPAGE2 103
51 | #define IDD_DEFENCODING 103
52 | #define IDC_FINDWORD 103
53 | #define IDC_RESIZEGRIP3 103
54 | #define IDB_NEXT 103
55 | #define IDC_STYLEFORE 103
56 | #define IDC_AUTOSTRIPBLANKS 103
57 | #define IDC_ENCODINGFROMFILEVARS 103
58 | #define IDD_ENCODING 104
59 | #define IDC_EMAIL2 104
60 | #define IDC_FINDSTART 104
61 | #define IDB_PICK 104
62 | #define IDC_STYLEBACK 104
63 | #define IDD_RECODE 105
64 | #define IDC_FINDREGEXP 105
65 | #define IDC_STYLEFONT 105
66 | #define IDB_ENCODING 105
67 | #define BME_RLVLINK2 105
68 | #define BME_RLV_LINK2 105
69 | #define IDD_DEFEOLMODE 106
70 | #define IDC_FINDTRANSFORMBS 106
71 | #define IDC_PREVIEW 106
72 | #define IDD_FAVORITES 107
73 | #define IDC_NOWRAP 107
74 | #define IDC_STYLEDEFAULT 107
75 | #define IDD_ADDTOFAV 108
76 | #define IDC_PREVSTYLE 108
77 | #define IDC_FINDCLOSE 108
78 | #define IDD_FILEMRU 109
79 | #define IDC_FINDPREV 109
80 | #define IDC_NEXTSTYLE 109
81 | #define IDD_CHANGENOTIFY 110
82 | #define IDC_SELECTTO 110
83 | #define IDC_IMPORT 110
84 | #define IDD_MODIFYLINES 111
85 | #define IDC_SELECTUP 111
86 | #define IDC_EXPORT 111
87 | #define IDD_ENCLOSESELECTION 112
88 | #define IDC_REPLACE 112
89 | #define IDC_TITLE 112
90 | #define IDD_INSERTTAG 113
91 | #define IDC_REPLACEALL 113
92 | #define IDC_STYLELABELS 113
93 | #define IDD_SORT 114
94 | #define IDC_REPLACEINSEL 114
95 | #define IDD_COLUMNWRAP 115
96 | #define IDC_TOGGLEFINDREPLACE 115
97 | #define IDD_LINENUM 116
98 | #define IDD_FIND 117
99 | #define IDD_REPLACE 118
100 | #define IDD_STYLESELECT 119
101 | #define IDD_STYLECONFIG 120
102 | #define IDD_WORDWRAP 121
103 | #define IDD_LONGLINES 122
104 | #define IDD_TABSETTINGS 123
105 | #define IDD_PAGESETUP 124
106 | #define IDD_INFOBOX 125
107 | #define IDD_INFOBOX2 126
108 | #define IDD_INFOBOX3 127
109 | #define IDC_RLV 150
110 | #define BME_RLV_LINK 150
111 | #define IDC_BACKSLASHHELP 151
112 | #define IDC_REGEXPHELP 152
113 | #define IDC_WILDCARDHELP 153
114 | #define IDC_WILDCARDSEARCH 154
115 | #define IDACC_FIND 200
116 | #define IDACC_REPLACE 201
117 | #define IDACC_SAVEPOS 202
118 | #define IDACC_RESETPOS 203
119 | #define IDS_APPTITLE 10000
120 | #define IDS_APPTITLE_ELEVATED 10001
121 | #define IDS_APPTITLE_PASTEBOARD 10002
122 | #define IDS_UNTITLED 10003
123 | #define IDS_TITLEEXCERPT 10004
124 | #define IDS_READONLY 10005
125 | #define IDS_DOCPOS 10006
126 | #define IDS_DOCPOS2 10007
127 | #define IDS_DOCSIZE 10008
128 | #define IDS_LOADFILE 10009
129 | #define IDS_SAVEFILE 10010
130 | #define IDS_PRINTFILE 10011
131 | #define IDS_SAVINGSETTINGS 10012
132 | #define IDS_LINKDESCRIPTION 10013
133 | #define IDS_FILTER_ALL 10014
134 | #define IDS_FILTER_EXE 10015
135 | #define IDS_FILTER_INI 10016
136 | #define IDS_OPENWITH 10017
137 | #define IDS_FAVORITES 10018
138 | #define IDS_BACKSLASHHELP 10019
139 | #define IDS_REGEXPHELP 10020
140 | #define IDS_WILDCARDHELP 10021
141 | #define CMD_ESCAPE 20000
142 | #define CMD_SHIFTESC 20001
143 | #define CMD_CTRLENTER 20002
144 | #define CMD_CTRLBACK 20003
145 | #define CMD_CTRLDEL 20004
146 | #define CMD_CTRLTAB 20005
147 | #define CMD_RELOADANSI 20006
148 | #define CMD_RELOADOEM 20007
149 | #define CMD_RELOADASCIIASUTF8 20008
150 | #define CMD_RELOADNOFILEVARS 20009
151 | #define CMD_LEXDEFAULT 20010
152 | #define CMD_LEXHTML 20011
153 | #define CMD_LEXXML 20012
154 | #define CMD_TIMESTAMPS 20013
155 | #define CMD_WEBACTION1 20014
156 | #define CMD_WEBACTION2 20015
157 | #define CMD_FINDNEXTSEL 20016
158 | #define CMD_FINDPREVSEL 20017
159 | #define CMD_INCLINELIMIT 20018
160 | #define CMD_DECLINELIMIT 20019
161 | #define CMD_STRINGIFY 20020
162 | #define CMD_STRINGIFY2 20021
163 | #define CMD_EMBRACE 20022
164 | #define CMD_EMBRACE2 20023
165 | #define CMD_EMBRACE3 20024
166 | #define CMD_EMBRACE4 20025
167 | #define CMD_INCREASENUM 20026
168 | #define CMD_DECREASENUM 20027
169 | #define CMD_TOGGLETITLE 20028
170 | #define CMD_JUMP2SELSTART 20029
171 | #define CMD_JUMP2SELEND 20030
172 | #define CMD_COPYPATHNAME 20031
173 | #define CMD_OPENINIFILE 20032
174 | #define IDM_FILE_NEW 40000
175 | #define IDM_FILE_OPEN 40001
176 | #define IDM_FILE_REVERT 40002
177 | #define IDM_FILE_BROWSE 40003
178 | #define IDM_FILE_SAVE 40004
179 | #define IDM_FILE_SAVEAS 40005
180 | #define IDM_FILE_SAVECOPY 40006
181 | #define IDM_FILE_READONLY 40007
182 | #define IDM_FILE_LAUNCH 40008
183 | #define IDM_FILE_OPENWITH 40009
184 | #define IDM_FILE_RUN 40010
185 | #define IDM_FILE_NEWWINDOW 40011
186 | #define IDM_FILE_NEWWINDOW2 40012
187 | #define IDM_FILE_PAGESETUP 40013
188 | #define IDM_FILE_PRINT 40014
189 | #define IDM_FILE_PROPERTIES 40015
190 | #define IDM_FILE_CREATELINK 40016
191 | #define IDM_FILE_OPENFAV 40017
192 | #define IDM_FILE_ADDTOFAV 40018
193 | #define IDM_FILE_MANAGEFAV 40019
194 | #define IDM_FILE_RECENT 40020
195 | #define IDM_FILE_EXIT 40021
196 | #define IDM_ENCODING_ANSI 40100
197 | #define IDM_ENCODING_UNICODE 40101
198 | #define IDM_ENCODING_UNICODEREV 40102
199 | #define IDM_ENCODING_UTF8 40103
200 | #define IDM_ENCODING_UTF8SIGN 40104
201 | #define IDM_ENCODING_SELECT 40105
202 | #define IDM_ENCODING_RECODE 40106
203 | #define IDM_ENCODING_SETDEFAULT 40107
204 | #define IDM_LINEENDINGS_CRLF 40200
205 | #define IDM_LINEENDINGS_LF 40201
206 | #define IDM_LINEENDINGS_CR 40202
207 | #define IDM_LINEENDINGS_SETDEFAULT 40203
208 | #define IDM_EDIT_BOOKMARKTOGGLE 40250
209 | #define IDM_EDIT_BOOKMARKNEXT 40251
210 | #define IMD_EDIT_BOOKMARKPREV 40252
211 | #define ID_EDIT_BOOKMARKS 40253
212 | #define ID_BOOKMARK_TOGGLE 40254
213 | #define ID_BOOKMARK_GOTONEXT 40255
214 | #define BME_EDIT_BOOKMARKTOGGLE 40255
215 | #define ID_BOOKMARK_GOTOPREVIOUS 40256
216 | #define BME_BOOKMARK_GOTONEXT 40256
217 | #define ID_BOOKMARKS_CLEARALL 40257
218 | #define BME_BOOKMARK_GOTOPREVIOUS 40257
219 | #define ID_BOOKMARKS_CLEARALL40248 40258
220 | #define BME_BOOKMARKS_CLEARALL 40258
221 | #define IDM_EDIT_BOOKMARKCLEAR 40259
222 | #define IDM_EDIT_BOOKMARKPREV 40260
223 | #define BME_EDIT_BOOKMARK_GOTONEXT 40260
224 | #define IDM_FILE_SAVEAS2 40261
225 | #define BME_EDIT_BOOKMARK_GOTOPREVIOUS 40261
226 | #define BME_EDIT_BOOKMARKS_CLEARALL 40262
227 | #define BME_EDIT_BOOKMARK_NEXT 40263
228 | #define BME_EDIT_BOOKMARK_PREVIOUS 40264
229 | #define BME_EDIT_BOOKMARKS_CLEAR 40265
230 | #define BME_EDIT_BOOKMARKNEXT 40266
231 | #define BME_EDIT_BOOKMARKPREVIOUS 40267
232 | #define BME_EDIT_BOOKMARKSCLEAR 40268
233 | #define BME_EDIT_BOOKMARKCLEAR 40269
234 | #define BME_EDIT_BOOKMARKPREV 40270
235 | #define BME_SAVEAS2 40271
236 | #define IDM_EDIT_UNDO 40300
237 | #define IDM_EDIT_REDO 40301
238 | #define IDM_EDIT_CUT 40302
239 | #define IDM_EDIT_COPY 40303
240 | #define IDM_EDIT_COPYALL 40304
241 | #define IDM_EDIT_COPYADD 40305
242 | #define IDM_EDIT_PASTE 40306
243 | #define IDM_EDIT_SWAP 40307
244 | #define IDM_EDIT_CLEAR 40308
245 | #define IDM_EDIT_CLEARCLIPBOARD 40309
246 | #define IDM_EDIT_SELECTALL 40310
247 | #define IDM_EDIT_SELECTWORD 40311
248 | #define IDM_EDIT_SELECTLINE 40312
249 | #define IDM_EDIT_MOVELINEUP 40313
250 | #define IDM_EDIT_MOVELINEDOWN 40314
251 | #define IDM_EDIT_DUPLICATELINE 40315
252 | #define IDM_EDIT_CUTLINE 40316
253 | #define IDM_EDIT_COPYLINE 40317
254 | #define IDM_EDIT_DELETELINE 40318
255 | #define IDM_EDIT_DELETELINELEFT 40319
256 | #define IDM_EDIT_DELETELINERIGHT 40320
257 | #define IDM_EDIT_COLUMNWRAP 40321
258 | #define IDM_EDIT_SPLITLINES 40322
259 | #define IDM_EDIT_JOINLINES 40323
260 | #define IDM_EDIT_JOINLINESEX 40324
261 | #define IDM_EDIT_INDENT 40325
262 | #define IDM_EDIT_UNINDENT 40326
263 | #define IDM_EDIT_ENCLOSESELECTION 40327
264 | #define IDM_EDIT_SELECTIONDUPLICATE 40328
265 | #define IDM_EDIT_PADWITHSPACES 40329
266 | #define IDM_EDIT_STRIP1STCHAR 40330
267 | #define IDM_EDIT_STRIPLASTCHAR 40331
268 | #define IDM_EDIT_TRIMLINES 40332
269 | #define IDM_EDIT_COMPRESSWS 40333
270 | #define IDM_EDIT_REMOVEBLANKLINES 40334
271 | #define IDM_EDIT_MODIFYLINES 40335
272 | #define IDM_EDIT_SORTLINES 40336
273 | #define IDM_EDIT_CONVERTUPPERCASE 40337
274 | #define IDM_EDIT_CONVERTLOWERCASE 40338
275 | #define IDM_EDIT_INVERTCASE 40339
276 | #define IDM_EDIT_TITLECASE 40340
277 | #define IDM_EDIT_SENTENCECASE 40341
278 | #define IDM_EDIT_CONVERTTABS 40342
279 | #define IDM_EDIT_CONVERTSPACES 40343
280 | #define IDM_EDIT_CONVERTTABS2 40344
281 | #define IDM_EDIT_CONVERTSPACES2 40345
282 | #define IDM_EDIT_INSERT_TAG 40346
283 | #define IDM_EDIT_INSERT_ENCODING 40347
284 | #define IDM_EDIT_INSERT_SHORTDATE 40348
285 | #define IDM_EDIT_INSERT_LONGDATE 40349
286 | #define IDM_EDIT_INSERT_FILENAME 40350
287 | #define IDM_EDIT_INSERT_PATHNAME 40351
288 | #define IDM_EDIT_LINECOMMENT 40352
289 | #define IDM_EDIT_STREAMCOMMENT 40353
290 | #define IDM_EDIT_URLENCODE 40354
291 | #define IDM_EDIT_URLDECODE 40355
292 | #define IDM_EDIT_ESCAPECCHARS 40356
293 | #define IDM_EDIT_UNESCAPECCHARS 40357
294 | #define IDM_EDIT_FINDMATCHINGBRACE 40358
295 | #define IDM_EDIT_SELTOMATCHINGBRACE 40359
296 | #define IDM_EDIT_FIND 40360
297 | #define IDM_EDIT_SAVEFIND 40361
298 | #define IDM_EDIT_FINDNEXT 40362
299 | #define IDM_EDIT_FINDPREV 40363
300 | #define IDM_EDIT_SELTONEXT 40364
301 | #define IDM_EDIT_SELTOPREV 40365
302 | #define IDM_EDIT_REPLACE 40366
303 | #define IDM_EDIT_REPLACENEXT 40367
304 | #define IDM_EDIT_GOTOLINE 40368
305 | #define IDM_VIEW_SCHEME 40400
306 | #define IDM_VIEW_USE2NDDEFAULT 40401
307 | #define IDM_VIEW_SCHEMECONFIG 40402
308 | #define IDM_VIEW_FONT 40403
309 | #define IDM_VIEW_WORDWRAP 40404
310 | #define IDM_VIEW_LONGLINEMARKER 40405
311 | #define IDM_VIEW_SHOWINDENTGUIDES 40406
312 | #define IDM_VIEW_SHOWWHITESPACE 40407
313 | #define IDM_VIEW_SHOWEOLS 40408
314 | #define IDM_VIEW_WORDWRAPSYMBOLS 40409
315 | #define IDM_VIEW_MATCHBRACES 40410
316 | #define IDM_VIEW_HILITECURRENTLINE 40411
317 | #define IDM_VIEW_LINENUMBERS 40412
318 | #define IDM_VIEW_MARGIN 40413
319 | #define IDM_VIEW_ZOOMIN 40414
320 | #define IDM_VIEW_ZOOMOUT 40415
321 | #define IDM_VIEW_RESETZOOM 40416
322 | #define IDM_VIEW_TABSASSPACES 40417
323 | #define IDM_VIEW_TABSETTINGS 40418
324 | #define IDM_VIEW_WORDWRAPSETTINGS 40419
325 | #define IDM_VIEW_LONGLINESETTINGS 40420
326 | #define IDM_VIEW_AUTOINDENTTEXT 40421
327 | #define IDM_VIEW_AUTOCLOSETAGS 40422
328 | #define IDM_VIEW_REUSEWINDOW 40423
329 | #define IDM_VIEW_STICKYWINPOS 40424
330 | #define IDM_VIEW_ALWAYSONTOP 40425
331 | #define IDM_VIEW_MINTOTRAY 40426
332 | #define IDM_VIEW_TRANSPARENT 40427
333 | #define IDM_VIEW_SINGLEFILEINSTANCE 40428
334 | #define IDM_VIEW_CHANGENOTIFY 40429
335 | #define IDM_VIEW_SHOWFILENAMEONLY 40430
336 | #define IDM_VIEW_SHOWFILENAMEFIRST 40431
337 | #define IDM_VIEW_SHOWFULLPATH 40432
338 | #define IDM_VIEW_SHOWEXCERPT 40433
339 | #define IDM_VIEW_NOESCFUNC 40434
340 | #define IDM_VIEW_ESCMINIMIZE 40435
341 | #define IDM_VIEW_ESCEXIT 40436
342 | #define IDM_VIEW_SAVEBEFORERUNNINGTOOLS 40437
343 | #define IDM_VIEW_NOSAVERECENT 40438
344 | #define IDM_VIEW_NOSAVEFINDREPL 40439
345 | #define IDM_VIEW_TOOLBAR 40440
346 | #define IDM_VIEW_CUSTOMIZETB 40441
347 | #define IDM_VIEW_STATUSBAR 40442
348 | #define IDM_VIEW_SAVESETTINGS 40443
349 | #define IDM_VIEW_SAVESETTINGSNOW 40444
350 | #define IDM_VIEW_FOLDING 40445
351 | #define IDM_VIEW_TOGGLEFOLDS 40446
352 | #define IDM_HELP_ABOUT 40500
353 | #define IDM_TRAY_RESTORE 40600
354 | #define IDM_TRAY_EXIT 40601
355 | #define IDT_FILE_NEW 40700
356 | #define IDT_FILE_OPEN 40701
357 | #define IDT_FILE_BROWSE 40702
358 | #define IDT_FILE_SAVE 40703
359 | #define IDT_EDIT_UNDO 40704
360 | #define IDT_EDIT_REDO 40705
361 | #define IDT_EDIT_CUT 40706
362 | #define IDT_EDIT_COPY 40707
363 | #define IDT_EDIT_PASTE 40708
364 | #define IDT_EDIT_FIND 40709
365 | #define IDT_EDIT_REPLACE 40710
366 | #define IDT_VIEW_WORDWRAP 40711
367 | #define IDT_VIEW_ZOOMIN 40712
368 | #define IDT_VIEW_ZOOMOUT 40713
369 | #define IDT_VIEW_SCHEME 40714
370 | #define IDT_VIEW_SCHEMECONFIG 40715
371 | #define IDT_FILE_EXIT 40716
372 | #define IDT_FILE_SAVEAS 40717
373 | #define IDT_FILE_SAVECOPY 40718
374 | #define IDT_EDIT_CLEAR 40719
375 | #define IDT_FILE_PRINT 40720
376 | #define IDT_FILE_OPENFAV 40721
377 | #define IDT_FILE_ADDTOFAV 40722
378 | #define IDT_VIEW_TOGGLEFOLDS 40723
379 | #define SC_SAVEPOS 40800
380 | #define SC_RESETPOS 40801
381 | #define IDS_ERR_LOADFILE 50000
382 | #define IDS_ERR_SAVEFILE 50001
383 | #define IDS_ERR_BROWSE 50002
384 | #define IDS_ERR_MRUDLG 50003
385 | #define IDS_ERR_CREATELINK 50004
386 | #define IDS_ERR_PREVWINDISABLED 50005
387 | #define IDS_SELRECT 50006
388 | #define IDS_FIND_WRAPFW 50007
389 | #define IDS_FIND_WRAPRE 50008
390 | #define IDS_NOTFOUND 50009
391 | #define IDS_REPLCOUNT 50010
392 | #define IDS_ASK_ENCODING 50011
393 | #define IDS_ASK_ENCODING2 50012
394 | #define IDS_ERR_ENCODINGNA 50013
395 | #define IDS_ERR_UNICODE 50014
396 | #define IDS_ERR_UNICODE2 50015
397 | #define IDS_WARNLOADBIGFILE 50016
398 | #define IDS_ERR_DROP 50017
399 | #define IDS_ASK_SAVE 50018
400 | #define IDS_ASK_REVERT 50019
401 | #define IDS_ASK_RECODE 50020
402 | #define IDS_ASK_CREATE 50021
403 | #define IDS_PRINT_HEADER 50022
404 | #define IDS_PRINT_FOOTER 50023
405 | #define IDS_PRINT_COLOR 50024
406 | #define IDS_PRINT_PAGENUM 50025
407 | #define IDS_PRINT_EMPTY 50026
408 | #define IDS_PRINT_ERROR 50027
409 | #define IDS_FAV_SUCCESS 50028
410 | #define IDS_FAV_FAILURE 50029
411 | #define IDS_READONLY_MODIFY 50030
412 | #define IDS_READONLY_SAVE 50031
413 | #define IDS_FILECHANGENOTIFY 50032
414 | #define IDS_FILECHANGENOTIFY2 50033
415 | #define IDS_STICKYWINPOS 50034
416 | #define IDS_SAVEDSETTINGS 50035
417 | #define IDS_CREATEINI_FAIL 50036
418 | #define IDS_WRITEINI_FAIL 50037
419 | #define IDS_SETTINGSNOTSAVED 50038
420 | #define IDS_IMPORT_OK 50039
421 | #define IDS_EXPORT_OK 50040
422 | #define IDS_CMDLINEHELP 60000
423 |
424 | // Next default values for new objects
425 | //
426 | #ifdef APSTUDIO_INVOKED
427 | #ifndef APSTUDIO_READONLY_SYMBOLS
428 | #define _APS_NO_MFC 1
429 | #define _APS_NEXT_RESOURCE_VALUE 361
430 | #define _APS_NEXT_COMMAND_VALUE 40273
431 | #define _APS_NEXT_CONTROL_VALUE 1152
432 | #define _APS_NEXT_SYMED_VALUE 180
433 | #endif
434 | #endif
435 |
--------------------------------------------------------------------------------
/src/scicall.h:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | *
3 | *
4 | * Notepad2
5 | *
6 | * SciCall.h
7 | * Inline wrappers for Scintilla API calls, arranged in the order and grouping
8 | * in which they appear in the Scintilla documentation.
9 | *
10 | * The use of these inline wrapper functions with declared types will ensure
11 | * that we get the benefit of the compiler's type checking.
12 | *
13 | *
14 | ******************************************************************************/
15 |
16 |
17 | //=============================================================================
18 | //
19 | // g_hScintilla
20 | //
21 | //
22 | extern HANDLE g_hScintilla;
23 |
24 | __forceinline void InitScintillaHandle(HWND hwnd) {
25 | g_hScintilla = (HANDLE)SendMessage(hwnd, SCI_GETDIRECTPOINTER, 0, 0);
26 | }
27 |
28 |
29 | //=============================================================================
30 | //
31 | // SciCall()
32 | //
33 | //
34 | LRESULT WINAPI Scintilla_DirectFunction(HANDLE, UINT, WPARAM, LPARAM);
35 | #define SciCall(m, w, l) Scintilla_DirectFunction(g_hScintilla, m, w, l)
36 |
37 |
38 | //=============================================================================
39 | //
40 | // DeclareSciCall[RV][0-2] Macros
41 | //
42 | // R: With an explicit return type
43 | // V: No return type defined ("void"); defaults to SendMessage's LRESULT
44 | // 0-2: Number of parameters to define
45 | //
46 | //
47 | #define DeclareSciCallR0(fn, msg, ret) \
48 | __forceinline ret SciCall_##fn() { \
49 | return((ret)SciCall(SCI_##msg, 0, 0)); \
50 | }
51 | #define DeclareSciCallR1(fn, msg, ret, type1, var1) \
52 | __forceinline ret SciCall_##fn(type1 var1) { \
53 | return((ret)SciCall(SCI_##msg, (WPARAM)(var1), 0)); \
54 | }
55 | #define DeclareSciCallR2(fn, msg, ret, type1, var1, type2, var2) \
56 | __forceinline ret SciCall_##fn(type1 var1, type2 var2) { \
57 | return((ret)SciCall(SCI_##msg, (WPARAM)(var1), (LPARAM)(var2))); \
58 | }
59 | #define DeclareSciCallV0(fn, msg) \
60 | __forceinline LRESULT SciCall_##fn() { \
61 | return(SciCall(SCI_##msg, 0, 0)); \
62 | }
63 | #define DeclareSciCallV1(fn, msg, type1, var1) \
64 | __forceinline LRESULT SciCall_##fn(type1 var1) { \
65 | return(SciCall(SCI_##msg, (WPARAM)(var1), 0)); \
66 | }
67 | #define DeclareSciCallV2(fn, msg, type1, var1, type2, var2) \
68 | __forceinline LRESULT SciCall_##fn(type1 var1, type2 var2) { \
69 | return(SciCall(SCI_##msg, (WPARAM)(var1), (LPARAM)(var2))); \
70 | }
71 |
72 |
73 | //=============================================================================
74 | //
75 | // Selection and information
76 | //
77 | //
78 | DeclareSciCallR0(GetLineCount, GETLINECOUNT, int);
79 | DeclareSciCallV2(SetSel, SETSEL, int, anchorPos, int, currentPos);
80 | DeclareSciCallV1(GotoPos, GOTOPOS, int, position);
81 | DeclareSciCallV1(GotoLine, GOTOLINE, int, line);
82 | DeclareSciCallR0(GetCurrentPos, GETCURRENTPOS, int);
83 | DeclareSciCallR1(LineFromPosition, LINEFROMPOSITION, int, int, position);
84 |
85 |
86 | //=============================================================================
87 | //
88 | // Scrolling and automatic scrolling
89 | //
90 | //
91 | DeclareSciCallV0(ScrollCaret, SCROLLCARET);
92 | DeclareSciCallV2(SetXCaretPolicy, SETXCARETPOLICY, int, caretPolicy, int, caretSlop);
93 | DeclareSciCallV2(SetYCaretPolicy, SETYCARETPOLICY, int, caretPolicy, int, caretSlop);
94 |
95 |
96 | //=============================================================================
97 | //
98 | // Style definition
99 | //
100 | //
101 | DeclareSciCallR1(StyleGetFore, STYLEGETFORE, COLORREF, int, styleNumber);
102 | DeclareSciCallR1(StyleGetBack, STYLEGETBACK, COLORREF, int, styleNumber);
103 |
104 |
105 | //=============================================================================
106 | //
107 | // Margins
108 | //
109 | //
110 | DeclareSciCallV2(SetMarginType, SETMARGINTYPEN, int, margin, int, type);
111 | DeclareSciCallV2(SetMarginWidth, SETMARGINWIDTHN, int, margin, int, pixelWidth);
112 | DeclareSciCallV2(SetMarginMask, SETMARGINMASKN, int, margin, int, mask);
113 | DeclareSciCallV2(SetMarginSensitive, SETMARGINSENSITIVEN, int, margin, BOOL, sensitive);
114 | DeclareSciCallV2(SetFoldMarginColour, SETFOLDMARGINCOLOUR, BOOL, useSetting, COLORREF, colour);
115 | DeclareSciCallV2(SetFoldMarginHiColour, SETFOLDMARGINHICOLOUR, BOOL, useSetting, COLORREF, colour);
116 |
117 |
118 | //=============================================================================
119 | //
120 | // Markers
121 | //
122 | //
123 | DeclareSciCallV2(MarkerDefine, MARKERDEFINE, int, markerNumber, int, markerSymbols);
124 | DeclareSciCallV2(MarkerSetFore, MARKERSETFORE, int, markerNumber, COLORREF, colour);
125 | DeclareSciCallV2(MarkerSetBack, MARKERSETBACK, int, markerNumber, COLORREF, colour);
126 |
127 |
128 | //=============================================================================
129 | //
130 | // Folding
131 | //
132 | //
133 | DeclareSciCallR1(GetLineVisible, GETLINEVISIBLE, BOOL, int, line);
134 | DeclareSciCallR1(GetFoldLevel, GETFOLDLEVEL, int, int, line);
135 | DeclareSciCallV1(SetFoldFlags, SETFOLDFLAGS, int, flags);
136 | DeclareSciCallR1(GetFoldParent, GETFOLDPARENT, int, int, line);
137 | DeclareSciCallR1(GetFoldExpanded, GETFOLDEXPANDED, int, int, line);
138 | DeclareSciCallV1(ToggleFold, TOGGLEFOLD, int, line);
139 | DeclareSciCallV1(EnsureVisible, ENSUREVISIBLE, int, line);
140 |
141 |
142 | //=============================================================================
143 | //
144 | // Lexer
145 | //
146 | //
147 | DeclareSciCallV2(SetProperty, SETPROPERTY, const char *, key, const char *, value);
148 |
--------------------------------------------------------------------------------
/todo.txt:
--------------------------------------------------------------------------------
1 | TODO
2 | ================================================================================
3 |
4 | * Run manifest tool inside Makefile
5 | * Add nsis Makefile target
6 |
7 |
--------------------------------------------------------------------------------