Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Notepad2 4.2.25-rc7

  • Loading branch information...
commit e94bb31472d2921b6998be0db58ee7a5e7643bee 1 parent eba3580
@djs authored
View
2  License.txt
@@ -1,4 +1,4 @@
-Notepad2 Copyright � 2004-2010 Florian Balmer
+Notepad2 Copyright � 2004-2011 Florian Balmer
All rights reserved.
Redistribution and use in source and binary forms, with or without
View
BIN  Notepad2.ini
Binary file not shown
View
98 Notepad2.txt
@@ -5,8 +5,8 @@
= Notepad2 - light-weight Scintilla-based text editor for Windows =
= =
= =
-= Notepad2 4.1.24 =
-= (c) Florian Balmer 2004-2010 =
+= Notepad2 4.2.25 =
+= (c) Florian Balmer 2004-2011 =
= http://www.flos-freeware.ch =
= =
= =
@@ -37,6 +37,53 @@ Features
- Mostly adjustable
+New in Version 4.2.25-rc7 (released April 02, 2011)
+
+ - "Align Lines" with several options (Alt+J)
+ - "Modify Lines" supports several variables to insert numbers (Alt+M)
+ - "Sort Lines" (Alt+O) handles column sort (rectangular selection)
+ - "Sort Lines" als handles shuffle, remove duplicate and unique lines
+ - Use built-in Windows functionality for "Title Case" on Windows 7
+ - Convert between characters and hex codes (Ctrl+Alt+X, Ctrl+Alt+C)
+ - "Recode file as default encoding" (Ctrl+Shift+F)
+ - UTF-16 and UTF-16 BE formats are valid recoding options
+ - Enable case-insensitive searching for non-ASCII text
+ - Regex quantifier ? to match 0 or 1 times
+ - Regex quantifiers * and + available as non-greedy forms *? and +?
+ - Regex syntax for tagged regions simplified from \(...\) to (...)
+ - Updated HTML5 and CSS3 schemes according to current working drafts
+ - Updated Assembly scheme with x64 and SSE4 instructions
+ - Several minor updates to syntax schemes and keywords
+ - Merged caret styles into a single item and added "noblink" option
+ - /l and /l- cmd switches to control auto-reloading of modified files
+ - Ini-option to specify auto-reload timeout (see FAQ on my website)
+ - Support combination of /g and /m command line switches
+ - /o and /o- cmd switches to control "Always on top" option
+ - Copy window position to clipboard as cmd line switch (Ctrl+Shift+K)
+ - Move window to default position on current screen (Ctrl+Shift+P)
+ - Fixed Notepad .LOG feature (broken since 4.1.24)
+ - Launch command uses current file directory as working directory
+ - Don't lock any directories except the one containing Notepad2.exe
+ - Forward system MRU, taskbar and jump list behaviour to new windows
+ - Always show file name extensions (ignore Windows Explorer setting)
+ - Check availability of "Consolas" when set as default font
+ - Support a few more file variables (see FAQ on my website)
+ - Configure whether backspace should reformat indenting whitespace
+ - Transform backslashes function understands \u#### hex codes
+ - Several F2, F3 and F4 hotkeys work in find and replace dialogs
+ - Removed "Select Up" and "Select Down" buttons from find dialog
+ - Ini-options to block suppression of notification messages
+ - Simplified appearance of word wrap settings dialog
+ - Remapped "Unescape C Special Chars" to Ctrl+Alt+R (fix duplicate)
+ - Various internal optimizations and fixes
+ - Improved look of disabled toolbar buttons on Windows XP and above
+ - Improved overall look of toolbar buttons on Windows 2k
+ - Lower frequency of NFS access delays by caching file display names
+ - Improved compatibility with Windows 7
+ - Released x64 build of Notepad2.exe
+ - Updated Scintilla library to 2.24
+
+
New in Version 4.1.24 (released March 02, 2010)
- /z command line switch (support registry-based Notepad replacement)
@@ -481,6 +528,7 @@ Keyboard Shortcuts for Notepad2
Ctrl+O Open file.
F5 Reload file.
F8 Recode file.
+ Ctrl+Shift+F Recode file as default encoding.
Ctrl+Shift+A Recode file as system default ANSI.
Ctrl+Shift+O Recode file as system default OEM.
Shift+F8 Recode 7-bit ASCII file as UTF-8.
@@ -564,6 +612,7 @@ Keyboard Shortcuts for Notepad2
Alt+P Compress whitespace.
Alt+R Remove blank lines.
Alt+M Modify lines.
+ Alt+J Align lines.
Alt+O Sort lines.
Convert
@@ -594,9 +643,13 @@ Keyboard Shortcuts for Notepad2
Ctrl+Shift+E URL Encode.
Ctrl+Shift+R URL Decode.
Ctrl+Alt+E Escape C Special Chars.
- Ctrl+Alt+U Unescape C Special Chars.
+ Ctrl+Alt+R Unescape C Special Chars.
+ Ctrl+Alt+X Convert character to hex code.
+ Ctrl+Alt+C Convert hex code to character.
Ctrl+B Find matching brace.
Ctrl+Shift+B Select to matching brace.
+ F2 Expand selection to next match.
+ Shift+F2 Expand selection to previous match.
Ctrl+1 Enclose within ''.
Ctrl+2 Enclose within "".
Ctrl+3 Enclose within ().
@@ -617,8 +670,6 @@ Keyboard Shortcuts for Notepad2
Shift+F3 Find previous.
Ctrl+F3 Find next word or selection.
Ctrl+Shift+F3 Find previous word or selection.
- F2 Expand selection to next match.
- Shift+F2 Expand selection to previous match.
Ctrl+H Replace.
F4 Replace next.
Ctrl+G Jump to line.
@@ -668,6 +719,8 @@ Keyboard Shortcuts for Notepad2
Misc.
Shift+F9 Copy pathname to clipboard.
+ Ctrl+Shift+K Copy window position to clipboard.
+ Ctrl+Shift+P Move window to default position.
Esc Optionally minimize or exit Notepad2.
Shift+Esc Save file and exit Notepad2.
F1 Display version info.
@@ -679,17 +732,14 @@ Regular Expression Syntax
basic subset of regular expression syntax, and searches are limited
to single lines.
- . Matches any character
-
- \( This marks the start of a region for tagging a match.
+ . Matches any character.
- \) This marks the end of a tagged region.
+ (...) This marks a region for tagging a match.
\n Where n is 1 through 9 refers to the first through ninth
tagged region when replacing. For example, if the search
- string was Fred\([1-9]\)XXX and the replace string was
- Sam\1YYY, when applied to Fred2XXX this would generate
- Sam2YYY.
+ string was Fred([1-9])XXX and the replace string was Sam\1YYY,
+ when applied to Fred2XXX this would generate Sam2YYY.
\< This matches the start of a word.
@@ -711,12 +761,17 @@ Regular Expression Syntax
$ This matches the end of a line.
+ ? This matches 0 or 1 times. For example, a?b matches ab and b.
+
* This matches 0 or more times. For example, Sa*m matches Sm,
Sam, Saam, Saaam and so on.
+ This matches 1 or more times. For example, Sa+m matches Sam,
Saam, Saaam and so on.
+ *? Causes * and + to behave non-greedy. For example, <.+> matches
+ +? all HTML tags on a line, whereas <.+?> matches only one tag.
+
\d Any decimal digit.
\D Any character that is not a decimal digit.
@@ -738,11 +793,11 @@ Regular Expression Syntax
Command Line Switches
- Notepad2.exe [(encoding)] [(line ending mode)] [/e id] [/g ln[,col]]
- [/m[-][r|b] text] [/q] [/s ext] [/d] [/h] [/x] [/c]
- [/b] [/n|/ns] [/r|/rs]
- [/p x,y,cx,cy[,max]|/p0|/ps|/pf,l,t,r,b,m]
- [/t title] [/i] [/f ini|/f0] [/u] [/z ...] [/?]
+ Notepad2.exe [encoding] [line-ending-mode] [/e id] [/g ln[,col]]
+ [/m[-][r|b] text] [/l|/l0] [/q] [/s ext] [/d] [/h] [/x]
+ [/c] [/b] [/n|/ns] [/r|/rs]
+ [/p x,y,cx,cy[,max]|/p0|/ps|/p[f|l|t|r|b|m]]
+ [/t title] [/i] [/o|/o0] [/f ini|/f0] [/u] [/z ...] [/?]
[+|-] [file] ...
file File to open, can be a relative pathname, or a shell link.
@@ -755,6 +810,7 @@ Command Line Switches
/e Specify file source encoding.
/g Jump to specified position, /g -1 means end of file.
/m Match specified text (/m- last, /mr regex, /mb backslash).
+ /l Auto-reload modified files; /l0 disable change notification.
/q Force creation of new files without prompt.
/s Select syntax scheme associated with specified extension.
/d Select default text scheme.
@@ -769,6 +825,7 @@ Command Line Switches
/p(f)ull,(l)eft,(t)op,(r)ight,(b)ottom,(m)argin.
/t Set window title.
/i Start as tray icon.
+ /o Keep window on top; /o0 do not keep window on top.
/f Specify ini-file; /f0 use no ini-file (don't save settings).
/u Launch with elevated privileges.
/z Skip next (usable for registry-based Notepad replacement).
@@ -812,12 +869,13 @@ Credits and Special Thanks
A special thank goes to Roland Weigelt [2] for his helpful thoughts
and comments about Notepad2 features and usability in early develop-
ment stages. I'd also like to express my thanks to Timo Kunze [3],
- to Kai Liu [4] and to Moritz Kroll for sending detailed bug reports
- and ready-to-use patches.
+ Kai Liu [4], Moritz Kroll, Seunghun Thomas Lee [5] and Shawn
+ Brenneman for sending detailed bug reports and ready-to-use patches.
[2] http://www.roland-weigelt.de
[3] http://www.TimoSoft-Software.de
[4] http://code.kliu.org/misc/notepad2/
+ [5] stlee42@gmail.com
Copyright
@@ -830,6 +888,6 @@ Copyright
If you have comments or questions, please drop me a note:
florian.balmer@gmail.com
- (c) Florian Balmer 2004-2010
+ (c) Florian Balmer 2004-2011
###
View
187 Notepad2.vcproj
@@ -19,14 +19,14 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="scintilla\include;scintilla\src;scintilla\win32"
- PreprocessorDefinitions="STATIC_BUILD;SCI_LEXER;UNICODE;_UNICODE"
+ AdditionalIncludeDirectories="scintilla\include;scintilla\src;scintilla\lexlib;scintilla\win32"
+ PreprocessorDefinitions="STATIC_BUILD;SCI_LEXER;_DEBUG;WIN32;_WINDOWS;UNICODE;_UNICODE;_M_IX86"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
+ Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
@@ -48,7 +48,8 @@
<Tool
Name="VCPreLinkEventTool"/>
<Tool
- Name="VCResourceCompilerTool"/>
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG;_M_IX86"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
@@ -65,14 +66,14 @@
Optimization="2"
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
- AdditionalIncludeDirectories="scintilla\include;scintilla\src;scintilla\win32"
- PreprocessorDefinitions="STATIC_BUILD;SCI_LEXER;NDEBUG;UNICODE;_UNICODE"
+ AdditionalIncludeDirectories="scintilla\include;scintilla\src;scintilla\lexlib;scintilla\win32"
+ PreprocessorDefinitions="STATIC_BUILD;SCI_LEXER;NDEBUG;WIN32;_WINDOWS;UNICODE;_UNICODE;_M_IX86"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="0"
WarningLevel="3"
- Detect64BitPortabilityProblems="FALSE"
+ Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="0"/>
<Tool
Name="VCCustomBuildTool"/>
@@ -95,7 +96,8 @@
<Tool
Name="VCPreLinkEventTool"/>
<Tool
- Name="VCResourceCompilerTool"/>
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG;_M_IX86"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
@@ -152,10 +154,13 @@
<File
RelativePath="src\resource.h">
</File>
+ <File
+ RelativePath="src\version.h">
+ </File>
</Filter>
<Filter
Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;manifest;xpm">
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;manifest;xpm;ver">
<File
RelativePath="res\Copy.cur">
</File>
@@ -166,9 +171,6 @@
RelativePath="res\Hover.cur">
</File>
<File
- RelativePath="scintilla\win32\Margin.cur">
- </File>
- <File
RelativePath="res\Next.bmp">
</File>
<File
@@ -181,6 +183,9 @@
RelativePath="src\Notepad2.rc">
</File>
<File
+ RelativePath="src\Notepad2.ver">
+ </File>
+ <File
RelativePath="res\Open.bmp">
</File>
<File
@@ -206,149 +211,196 @@
Name="include"
Filter="">
<File
- RelativePath="scintilla\include\Accessor.h">
+ RelativePath="scintilla\include\ILexer.h">
</File>
<File
- RelativePath="scintilla\include\KeyWords.h">
+ RelativePath="scintilla\include\Platform.h">
</File>
<File
- RelativePath="scintilla\include\Platform.h">
+ RelativePath="scintilla\include\SciLexer.h">
+ </File>
+ <File
+ RelativePath="scintilla\include\Scintilla.h">
+ </File>
+ <File
+ RelativePath="scintilla\include\ScintillaWidget.h">
</File>
+ </Filter>
+ <Filter
+ Name="lexers"
+ Filter="">
<File
- RelativePath="scintilla\include\PropSet.h">
+ RelativePath="scintilla\lexers\LexAsm.cxx">
</File>
<File
- RelativePath="scintilla\include\SString.h">
+ RelativePath="scintilla\lexers\LexCPP.cxx">
</File>
<File
- RelativePath="scintilla\include\SciLexer.h">
+ RelativePath="scintilla\lexers\LexCSS.cxx">
</File>
<File
- RelativePath="scintilla\include\Scintilla.h">
+ RelativePath="scintilla\lexers\LexConf.cxx">
</File>
<File
- RelativePath="scintilla\include\ScintillaWidget.h">
+ RelativePath="scintilla\lexers\LexHTML.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\lexers\LexOthers.cxx">
</File>
<File
- RelativePath="scintilla\include\WindowAccessor.h">
+ RelativePath="scintilla\lexers\LexPascal.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\lexers\LexPerl.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\lexers\LexPowerShell.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\lexers\LexPython.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\lexers\LexSQL.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\lexers\LexVB.cxx">
</File>
</Filter>
<Filter
- Name="src"
+ Name="lexlib"
Filter="">
<File
- RelativePath="scintilla\src\AutoComplete.cxx">
+ RelativePath="scintilla\lexlib\Accessor.cxx">
</File>
<File
- RelativePath="scintilla\src\AutoComplete.h">
+ RelativePath="scintilla\lexlib\Accessor.h">
</File>
<File
- RelativePath="scintilla\src\CallTip.cxx">
+ RelativePath="scintilla\lexlib\CharacterSet.cxx">
</File>
<File
- RelativePath="scintilla\src\CallTip.h">
+ RelativePath="scintilla\lexlib\CharacterSet.h">
</File>
<File
- RelativePath="scintilla\src\CellBuffer.cxx">
+ RelativePath="scintilla\lexlib\LexAccessor.h">
</File>
<File
- RelativePath="scintilla\src\CellBuffer.h">
+ RelativePath="scintilla\lexlib\LexerBase.cxx">
</File>
<File
- RelativePath="scintilla\src\CharClassify.cxx">
+ RelativePath="scintilla\lexlib\LexerBase.h">
</File>
<File
- RelativePath="scintilla\src\CharClassify.h">
+ RelativePath="scintilla\lexlib\LexerModule.cxx">
</File>
<File
- RelativePath="scintilla\src\CharacterSet.h">
+ RelativePath="scintilla\lexlib\LexerModule.h">
</File>
<File
- RelativePath="scintilla\src\ContractionState.cxx">
+ RelativePath="scintilla\lexlib\LexerSimple.cxx">
</File>
<File
- RelativePath="scintilla\src\ContractionState.h">
+ RelativePath="scintilla\lexlib\LexerSimple.h">
</File>
<File
- RelativePath="scintilla\src\Decoration.cxx">
+ RelativePath="scintilla\lexlib\OptionSet.h">
</File>
<File
- RelativePath="scintilla\src\Decoration.h">
+ RelativePath="scintilla\lexlib\PropSetSimple.cxx">
</File>
<File
- RelativePath="scintilla\src\Document.cxx">
+ RelativePath="scintilla\lexlib\PropSetSimple.h">
</File>
<File
- RelativePath="scintilla\src\Document.h">
+ RelativePath="scintilla\lexlib\StyleContext.cxx">
</File>
<File
- RelativePath="scintilla\src\DocumentAccessor.cxx">
+ RelativePath="scintilla\lexlib\StyleContext.h">
</File>
<File
- RelativePath="scintilla\src\DocumentAccessor.h">
+ RelativePath="scintilla\lexlib\WordList.cxx">
</File>
<File
- RelativePath="scintilla\src\Editor.cxx">
+ RelativePath="scintilla\lexlib\WordList.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="src"
+ Filter="">
+ <File
+ RelativePath="scintilla\src\AutoComplete.cxx">
</File>
<File
- RelativePath="scintilla\src\Editor.h">
+ RelativePath="scintilla\src\AutoComplete.h">
</File>
<File
- RelativePath="scintilla\src\ExternalLexer.cxx">
+ RelativePath="scintilla\src\CallTip.cxx">
</File>
<File
- RelativePath="scintilla\src\ExternalLexer.h">
+ RelativePath="scintilla\src\CallTip.h">
</File>
<File
- RelativePath="scintilla\src\Indicator.cxx">
+ RelativePath="scintilla\src\Catalogue.cxx">
</File>
<File
- RelativePath="scintilla\src\Indicator.h">
+ RelativePath="scintilla\src\Catalogue.h">
</File>
<File
- RelativePath="scintilla\src\KeyMap.cxx">
+ RelativePath="scintilla\src\CellBuffer.cxx">
</File>
<File
- RelativePath="scintilla\src\KeyMap.h">
+ RelativePath="scintilla\src\CellBuffer.h">
</File>
<File
- RelativePath="scintilla\src\KeyWords.cxx">
+ RelativePath="scintilla\src\CharClassify.cxx">
</File>
<File
- RelativePath="scintilla\src\LexAsm.cxx">
+ RelativePath="scintilla\src\CharClassify.h">
</File>
<File
- RelativePath="scintilla\src\LexCPP.cxx">
+ RelativePath="scintilla\src\ContractionState.cxx">
</File>
<File
- RelativePath="scintilla\src\LexCSS.cxx">
+ RelativePath="scintilla\src\ContractionState.h">
</File>
<File
- RelativePath="scintilla\src\LexConf.cxx">
+ RelativePath="scintilla\src\Decoration.cxx">
</File>
<File
- RelativePath="scintilla\src\LexHTML.cxx">
+ RelativePath="scintilla\src\Decoration.h">
</File>
<File
- RelativePath="scintilla\src\LexOthers.cxx">
+ RelativePath="scintilla\src\Document.cxx">
</File>
<File
- RelativePath="scintilla\src\LexPascal.cxx">
+ RelativePath="scintilla\src\Document.h">
</File>
<File
- RelativePath="scintilla\src\LexPerl.cxx">
+ RelativePath="scintilla\src\Editor.cxx">
</File>
<File
- RelativePath="scintilla\src\LexPowerShell.cxx">
+ RelativePath="scintilla\src\Editor.h">
</File>
<File
- RelativePath="scintilla\src\LexPython.cxx">
+ RelativePath="scintilla\src\ExternalLexer.cxx">
</File>
<File
- RelativePath="scintilla\src\LexSQL.cxx">
+ RelativePath="scintilla\src\ExternalLexer.h">
</File>
<File
- RelativePath="scintilla\src\LexVB.cxx">
+ RelativePath="scintilla\src\FontQuality.h">
+ </File>
+ <File
+ RelativePath="scintilla\src\Indicator.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\src\Indicator.h">
+ </File>
+ <File
+ RelativePath="scintilla\src\KeyMap.cxx">
+ </File>
+ <File
+ RelativePath="scintilla\src\KeyMap.h">
</File>
<File
RelativePath="scintilla\src\LineMarker.cxx">
@@ -372,9 +424,6 @@
RelativePath="scintilla\src\PositionCache.h">
</File>
<File
- RelativePath="scintilla\src\PropSet.cxx">
- </File>
- <File
RelativePath="scintilla\src\RESearch.cxx">
</File>
<File
@@ -411,12 +460,6 @@
RelativePath="scintilla\src\Style.h">
</File>
<File
- RelativePath="scintilla\src\StyleContext.cxx">
- </File>
- <File
- RelativePath="scintilla\src\StyleContext.h">
- </File>
- <File
RelativePath="scintilla\src\UniConversion.cxx">
</File>
<File
@@ -429,9 +472,6 @@
RelativePath="scintilla\src\ViewStyle.h">
</File>
<File
- RelativePath="scintilla\src\WindowAccessor.cxx">
- </File>
- <File
RelativePath="scintilla\src\XPM.cxx">
</File>
<File
@@ -445,9 +485,6 @@
RelativePath="scintilla\win32\PlatWin.cxx">
</File>
<File
- RelativePath="scintilla\win32\PlatformRes.h">
- </File>
- <File
RelativePath="scintilla\win32\ScintillaWin.cxx">
</File>
</Filter>
View
37 Readme.txt
@@ -5,8 +5,8 @@
= Notepad2 - light-weight Scintilla-based text editor for Windows =
= =
= =
-= Notepad2 4.1.24 =
-= (c) Florian Balmer 2004-2010 =
+= Notepad2 4.2.25 =
+= (c) Florian Balmer 2004-2011 =
= http://www.flos-freeware.ch =
= =
= =
@@ -15,7 +15,7 @@
The Notepad2 Source Code
- This package contains the full source code of Notepad2 4.1.24 for
+ This package contains the full source code of Notepad2 4.2.25 for
Windows. Project files for Visual C++ 7.0 are included. Chances are
that Notepad2 can be rebuilt with other development tools, including
the free Visual C++ Express Edition, but I haven't tested this.
@@ -23,22 +23,17 @@ The Notepad2 Source Code
Rebuilding from the Source Code
- To be able to rebuild Notepad2, the source code of the Scintilla
- editing component [1] has to be unzipped to the "Scintilla"
- subdirectory of the Notepad2 source code directory.
+ Notepad2 4.2.25-rc7 is based on Scintilla 2.24 [1].
[1] http://www.scintilla.org
- Notepad2 4.1.24 has been created with Scintilla 2.03. The following
- modification to the Scintilla source code is necessary:
-
- Scintilla/src/KeyWords.cxx:
-
- #define LINK_LEXER(lexer) extern LexerModule lexer; ...
-
- must be replaced with:
+ To be able to rebuild Notepad2, the source code of the Scintilla
+ editing component has to be unzipped to the "scintilla" subdirectory
+ of the Notepad2 source code directory.
- #define LINK_LEXER(lexer) void(0)
+ Many of the Scintilla lexing modules are not used by Notepad2. Run
+ LinkLex.js to adapt the list (in "scintilla/src/Catalogue.cxx") and
+ make linking work properly.
Creating a Compact Executable Program File
@@ -49,7 +44,7 @@ Creating a Compact Executable Program File
Notepad2.exe is built using the Windows Driver Kit (WDK) 7.1.0 tools,
available as a free download from Microsoft. The appropriate build
scripts can be found in the "wdkbuild" subdirectory. Set %WDKBASEDIR%
- to the directory where the WDK tools are located on your system.
+ to the directory of the WDK tools on your system.
How to add or modify Syntax Schemes
@@ -60,9 +55,11 @@ How to add or modify Syntax Schemes
Add your own lexer data structs to the global pLexArray (Styles.c),
then adjust NUMLEXERS (Styles.h) to the new total number of syntax
- schemes. The style definitions can be found in SciLexer.h of the
- Scintilla source code. Include the Lex*.cxx file from Scintilla
- required for your language into your project.
+ schemes. Include the "scintilla/lexers/Lex*.cxx" file required for
+ your language into your project. Ensure the new module is initialized
+ (in "scintilla/src/Catalogue.cxx"), either by manually uncommenting
+ the corresponding LINK_LEXER() macro call, or by updating and
+ re-running LinkLex.js.
Copyright
@@ -72,7 +69,7 @@ Copyright
If you have any comments or questions, please drop me a note:
florian.balmer@gmail.com
- (c) Florian Balmer 2004-2010
+ (c) Florian Balmer 2004-2011
http://www.flos-freeware.ch
###
View
39 lexlink.js
@@ -0,0 +1,39 @@
+/*
+ Comment lexer modules from "scintilla\src\Catalogue.cxx" not used by Notepad2
+ (c) Florian Balmer 2011
+*/
+
+ var lex = new Array(
+ "lmAsm",
+ "lmBatch",
+ "lmConf",
+ "lmCPP",
+ "lmCss",
+ "lmDiff",
+ "lmHTML",
+ "lmMake",
+ "lmNull",
+ "lmPascal",
+ "lmPerl",
+ "lmPowerShell",
+ "lmProps",
+ "lmPython",
+ "lmSQL",
+ "lmVB",
+ "lmVBScript",
+ "lmXML"
+ );
+
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+ var fh = fso.OpenTextFile("scintilla\\src\\Catalogue.cxx",1,0);
+ if (!fh.AtEndOfStream) {
+ var str = fh.ReadAll();
+ str = str.replace(
+ /^(\s*)\/\/(LINK_LEXER)/gim,
+ "$1$2");
+ var re = new RegExp("^(\\s*)(LINK_LEXER\\((?!"+lex.join("|")+")\\w+\\);)","gim")
+ str = str.replace(re,"$1//$2");
+ fh.Close();
+ var fh = fso.OpenTextFile("scintilla\\src\\Catalogue.cxx",2,0);
+ fh.Write(str);
+ }
View
67 res/Notepad2.exe.manifest
@@ -1,32 +1,39 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <assemblyIdentity
- name="Notepad2"
- processorArchitecture="x86"
- version="5.1.0.0"
- type="win32"
- />
- <description>Notepad2</description>
- <dependency>
- <dependentAssembly>
- <assemblyIdentity
- type="win32"
- name="Microsoft.Windows.Common-Controls"
- version="6.0.0.0"
- processorArchitecture="x86"
- publicKeyToken="6595b64144ccf1df"
- language="*"
- />
- </dependentAssembly>
- </dependency>
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel
- level="asInvoker"
- uiAccess="false"
- />
- </requestedPrivileges>
- </security>
- </trustInfo>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <assemblyIdentity
+ name="Notepad2"
+ version="5.1.0.0"
+ type="win32"/>
+ <description>Notepad2</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"/>
+ </dependentAssembly>
+ </dependency>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel
+ level="asInvoker"
+ uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
+ </application>
+ </compatibility>
+ <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+ <dpiAware>true</dpiAware>
+ </asmv3:windowsSettings>
+ </asmv3:application>
</assembly>
View
149 src/Dialogs.c
@@ -11,7 +11,7 @@
*
* See License.txt for details about distribution and modification.
*
-* (c) Florian Balmer 1996-2010
+* (c) Florian Balmer 1996-2011
* florian.balmer@gmail.com
* http://www.flos-freeware.ch
*
@@ -32,12 +32,12 @@
#include "dlapi.h"
#include "dialogs.h"
#include "resource.h"
+#include "version.h"
extern HWND hwndMain;
extern HWND hwndEdit;
extern HINSTANCE g_hInstance;
-extern LPMALLOC g_lpMalloc;
extern DWORD dwLastIOError;
extern BOOL bSkipUnicodeDetection;
extern BOOL bLoadASCIIasUTF8;
@@ -67,7 +67,8 @@ int MsgBox(int iType,UINT uIdMsg,...)
wvsprintf(szText,szBuf,(LPVOID)((PUINT_PTR)&uIdMsg + 1));
if (uIdMsg == IDS_ERR_LOADFILE || uIdMsg == IDS_ERR_SAVEFILE ||
- uIdMsg == IDS_CREATEINI_FAIL || uIdMsg == IDS_WRITEINI_FAIL) {
+ uIdMsg == IDS_CREATEINI_FAIL || uIdMsg == IDS_WRITEINI_FAIL ||
+ uIdMsg == IDS_EXPORT_FAIL) {
LPVOID lpMsgBuf;
WCHAR wcht;
FormatMessage(
@@ -162,7 +163,6 @@ BOOL GetDirectory(HWND hwndParent,int iTitle,LPWSTR pszFolder,LPCWSTR pszBase,BO
BROWSEINFO bi;
LPITEMIDLIST pidl;
- //LPMALLOC lpMalloc;
WCHAR szTitle[256];
WCHAR szBase[MAX_PATH];
BOOL fOk = FALSE;
@@ -186,19 +186,12 @@ BOOL GetDirectory(HWND hwndParent,int iTitle,LPWSTR pszFolder,LPCWSTR pszBase,BO
bi.lParam = (LPARAM)szBase;
bi.iImage = 0;
- //if (SHGetMalloc(&lpMalloc) != NOERROR)
- // return FALSE;
-
pidl = SHBrowseForFolder(&bi);
- if (pidl)
- {
+ if (pidl) {
SHGetPathFromIDList(pidl,pszFolder);
-
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,pidl);
-
+ CoTaskMemFree(pidl);
fOk = TRUE;
}
- //lpMalloc->lpVtbl->Release(lpMalloc);
return fOk;
@@ -209,14 +202,7 @@ BOOL GetDirectory(HWND hwndParent,int iTitle,LPWSTR pszFolder,LPCWSTR pszBase,BO
//
// AboutDlgProc()
//
-static const DWORD dwVerMajor = 4;
-static const DWORD dwVerMinor = 1;
-static const DWORD dwBuildNumber = 24;
-static const WCHAR* szRevision = L"";
-static const WCHAR* szExtra = L"";
-static const BOOL bReleaseBuild = TRUE;
-
-BOOL CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
static HFONT hFontTitle;
@@ -225,23 +211,12 @@ BOOL CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
case WM_INITDIALOG:
{
- WCHAR szVersion[64];
- WCHAR szDate[64];
- WCHAR szLink[256];
- WCHAR szLinkCode[256];
+ WCHAR wch[256];
LOGFONT lf;
- if (bReleaseBuild) {
- wsprintf(szVersion,L"Notepad2 %u.%u.%0.2u%s",
- dwVerMajor,dwVerMinor,dwBuildNumber,szRevision);
- SetDlgItemText(hwnd,IDC_VERSION,szVersion);
- }
- else {
- MultiByteToWideChar(CP_ACP,0,__DATE__,-1,szDate,COUNTOF(szDate));
- wsprintf(szVersion,L"Notepad2 %u.%u.%0.2u%s%s %s",
- dwVerMajor,dwVerMinor,dwBuildNumber,szRevision,szExtra,szDate);
- SetDlgItemText(hwnd,IDC_VERSION,szVersion);
- }
+ SetDlgItemText(hwnd,IDC_VERSION,VERSION_FILEVERSION_LONG);
+ SetDlgItemText(hwnd,IDC_COPYRIGHT,VERSION_LEGALCOPYRIGHT_SHORT);
+ SetDlgItemText(hwnd,IDC_AUTHORNAME,VERSION_AUTHORNAME);
if (hFontTitle)
DeleteObject(hFontTitle);
@@ -253,20 +228,22 @@ BOOL CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
hFontTitle = CreateFontIndirect(&lf);
SendDlgItemMessage(hwnd,IDC_VERSION,WM_SETFONT,(WPARAM)hFontTitle,TRUE);
- if (GetDlgItem(hwnd,IDC_WEBPAGE) == NULL)
+ if (GetDlgItem(hwnd,IDC_WEBPAGE) == NULL) {
+ SetDlgItemText(hwnd,IDC_WEBPAGE2,VERSION_WEBPAGEDISPLAY);
ShowWindow(GetDlgItem(hwnd,IDC_WEBPAGE2),SW_SHOWNORMAL);
+ }
else {
- GetDlgItemText(hwnd,IDC_WEBPAGE2,szLink,COUNTOF(szLink));
- wsprintf(szLinkCode,L"<A>%s</A>",szLink);
- SetDlgItemText(hwnd,IDC_WEBPAGE,szLinkCode);
+ wsprintf(wch,L"<A>%s</A>",VERSION_WEBPAGEDISPLAY);
+ SetDlgItemText(hwnd,IDC_WEBPAGE,wch);
}
- if (GetDlgItem(hwnd,IDC_EMAIL) == NULL)
+ if (GetDlgItem(hwnd,IDC_EMAIL) == NULL) {
+ SetDlgItemText(hwnd,IDC_EMAIL2,VERSION_EMAILDISPLAY);
ShowWindow(GetDlgItem(hwnd,IDC_EMAIL2),SW_SHOWNORMAL);
+ }
else {
- GetDlgItemText(hwnd,IDC_EMAIL2,szLink,COUNTOF(szLink));
- wsprintf(szLinkCode,L"<A>%s</A>",szLink);
- SetDlgItemText(hwnd,IDC_EMAIL,szLinkCode);
+ wsprintf(wch,L"<A>%s</A>",VERSION_EMAILDISPLAY);
+ SetDlgItemText(hwnd,IDC_EMAIL,wch);
}
CenterDlgInParent(hwnd);
@@ -313,7 +290,7 @@ BOOL CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
//
// RunDlgProc()
//
-BOOL CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK RunDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
switch(umsg)
@@ -490,7 +467,7 @@ extern int flagNoFadeHidden;
extern int cxOpenWithDlg;
extern int cyOpenWithDlg;
-BOOL CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
switch(umsg)
@@ -502,7 +479,7 @@ BOOL CALLBACK OpenWithDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
ResizeDlg_Init(hwnd,cxOpenWithDlg,cyOpenWithDlg,IDC_RESIZEGRIP3);
- SetWindowLongPtr(hwnd,DWLP_USER,lParam);
+ SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
//SetExplorerTheme(GetDlgItem(hwnd,IDC_OPENWITHDIR));
ListView_SetExtendedListViewStyle(GetDlgItem(hwnd,IDC_OPENWITHDIR),/*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER|LVS_EX_LABELTIP);
@@ -692,7 +669,7 @@ extern WCHAR tchFavoritesDir[MAX_PATH];
extern int cxFavoritesDlg;
extern int cyFavoritesDlg;
-BOOL CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
static HWND hwndLV;
@@ -706,7 +683,7 @@ BOOL CALLBACK FavoritesDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
ResizeDlg_Init(hwnd,cxFavoritesDlg,cyFavoritesDlg,IDC_RESIZEGRIP3);
- SetWindowLongPtr(hwnd,DWLP_USER,lParam);
+ SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
//SetExplorerTheme(GetDlgItem(hwnd,IDC_FAVORITESDIR));
ListView_SetExtendedListViewStyle(GetDlgItem(hwnd,IDC_FAVORITESDIR),/*LVS_EX_FULLROWSELECT|*/LVS_EX_DOUBLEBUFFER|LVS_EX_LABELTIP);
@@ -865,7 +842,7 @@ BOOL FavoritesDlg(HWND hwnd,LPWSTR lpstrFile)
//
// Controls: 100 Edit
//
-BOOL CALLBACK AddToFavDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK AddToFavDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
switch(umsg)
@@ -925,7 +902,7 @@ BOOL CALLBACK AddToFavDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
BOOL AddToFavDlg(HWND hwnd,LPCWSTR lpszName,LPCWSTR lpszTarget)
{
- int iResult;
+ INT_PTR iResult;
WCHAR pszName[MAX_PATH];
lstrcpy(pszName,lpszName);
@@ -1059,7 +1036,7 @@ DWORD WINAPI FileMRUIconThread(LPVOID lpParam) {
return(0);
}
-BOOL CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
switch(umsg)
@@ -1076,7 +1053,7 @@ BOOL CALLBACK FileMRUDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
lpit->hExitThread = CreateEvent(NULL,TRUE,FALSE,NULL);
lpit->hTerminatedThread = CreateEvent(NULL,TRUE,TRUE,NULL);
- SetWindowLongPtr(hwnd,DWLP_USER,lParam);
+ SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
ResizeDlg_Init(hwnd,cxFileMRUDlg,cyFileMRUDlg,IDC_RESIZEGRIP);
@@ -1389,7 +1366,7 @@ BOOL FileMRUDlg(HWND hwnd,LPWSTR lpstrFile)
extern int iFileWatchingMode;
extern BOOL bResetFileWatching;
-BOOL CALLBACK ChangeNotifyDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK ChangeNotifyDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
switch(umsg)
{
@@ -1431,7 +1408,7 @@ BOOL CALLBACK ChangeNotifyDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lPara
BOOL ChangeNotifyDlg(HWND hwnd)
{
- int iResult;
+ INT_PTR iResult;
iResult = ThemedDialogBoxParam(
g_hInstance,
@@ -1451,7 +1428,7 @@ BOOL ChangeNotifyDlg(HWND hwnd)
//
// Controls: 100 Edit
//
-BOOL CALLBACK ColumnWrapDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK ColumnWrapDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
static int *piNumber;
@@ -1520,7 +1497,7 @@ BOOL CALLBACK ColumnWrapDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
BOOL ColumnWrapDlg(HWND hwnd,UINT uidDlg,int *iNumber)
{
- int iResult;
+ INT_PTR iResult;
iResult = ThemedDialogBoxParam(
g_hInstance,
@@ -1551,7 +1528,7 @@ extern int iWordWrapIndent;
extern int iWordWrapSymbols;
extern BOOL bShowWordWrapSymbols;
-BOOL CALLBACK WordWrapSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK WordWrapSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
switch(umsg)
@@ -1598,18 +1575,18 @@ BOOL CALLBACK WordWrapSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM l
int iSel, iSel2;
- iSel = SendDlgItemMessage(hwnd,100,CB_GETCURSEL,0,0);
+ iSel = (int)SendDlgItemMessage(hwnd,100,CB_GETCURSEL,0,0);
iWordWrapIndent = iSel;
bShowWordWrapSymbols = FALSE;
- iSel = SendDlgItemMessage(hwnd,101,CB_GETCURSEL,0,0);
- iSel2 = SendDlgItemMessage(hwnd,102,CB_GETCURSEL,0,0);
+ iSel = (int)SendDlgItemMessage(hwnd,101,CB_GETCURSEL,0,0);
+ iSel2 = (int)SendDlgItemMessage(hwnd,102,CB_GETCURSEL,0,0);
if (iSel > 0 || iSel2 > 0) {
bShowWordWrapSymbols = TRUE;
iWordWrapSymbols = iSel + iSel2*10;
}
- iSel = SendDlgItemMessage(hwnd,103,CB_GETCURSEL,0,0);
+ iSel = (int)SendDlgItemMessage(hwnd,103,CB_GETCURSEL,0,0);
iWordWrapMode = iSel;
EndDialog(hwnd,IDOK);
@@ -1639,7 +1616,7 @@ BOOL CALLBACK WordWrapSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM l
BOOL WordWrapSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
{
- int iResult;
+ INT_PTR iResult;
iResult = ThemedDialogBoxParam(
g_hInstance,
@@ -1662,7 +1639,7 @@ BOOL WordWrapSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
//
extern int iLongLineMode;
-BOOL CALLBACK LongLineSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK LongLineSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
static int *piNumber;
@@ -1738,7 +1715,7 @@ BOOL CALLBACK LongLineSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM l
BOOL LongLineSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
{
- int iResult;
+ INT_PTR iResult;
iResult = ThemedDialogBoxParam(
g_hInstance,
@@ -1759,13 +1736,15 @@ BOOL LongLineSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
// 101 Edit
// 102 Check
// 103 Check
+// 104 Check
//
extern int iTabWidth;
extern int iIndentWidth;
extern BOOL bTabsAsSpaces;
extern BOOL bTabIndents;
+extern BOOL bBackspaceUnindents;
-BOOL CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
switch(umsg)
@@ -1786,6 +1765,9 @@ BOOL CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam
if (bTabIndents)
CheckDlgButton(hwnd,103,BST_CHECKED);
+ if (bBackspaceUnindents)
+ CheckDlgButton(hwnd,104,BST_CHECKED);
+
CenterDlgInParent(hwnd);
}
@@ -1813,6 +1795,8 @@ BOOL CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam
bTabIndents = (IsDlgButtonChecked(hwnd,103)) ? TRUE : FALSE;
+ bBackspaceUnindents = (IsDlgButtonChecked(hwnd,104)) ? TRUE : FALSE;
+
EndDialog(hwnd,IDOK);
}
@@ -1845,7 +1829,7 @@ BOOL CALLBACK TabSettingsDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam
BOOL TabSettingsDlg(HWND hwnd,UINT uidDlg,int *iNumber)
{
- int iResult;
+ INT_PTR iResult;
iResult = ThemedDialogBoxParam(
g_hInstance,
@@ -1870,7 +1854,7 @@ typedef struct encodedlg {
int cyDlg;
} ENCODEDLG, *PENCODEDLG;
-BOOL CALLBACK SelectDefEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK SelectDefEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
static PENCODEDLG pdd;
@@ -1938,7 +1922,7 @@ BOOL CALLBACK SelectDefEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM
BOOL SelectDefEncodingDlg(HWND hwnd,int *pidREncoding)
{
- int iResult;
+ INT_PTR iResult;
ENCODEDLG dd;
dd.bRecodeOnly = FALSE;
@@ -1966,7 +1950,7 @@ BOOL SelectDefEncodingDlg(HWND hwnd,int *pidREncoding)
// SelectEncodingDlgProc()
//
//
-BOOL CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK SelectEncodingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
static PENCODEDLG pdd;
@@ -2094,7 +2078,7 @@ extern int cyEncodingDlg;
BOOL SelectEncodingDlg(HWND hwnd,int *pidREncoding)
{
- int iResult;
+ INT_PTR iResult;
ENCODEDLG dd;
dd.bRecodeOnly = FALSE;
@@ -2132,7 +2116,7 @@ extern int cyRecodeDlg;
BOOL RecodeDlg(HWND hwnd,int *pidREncoding)
{
- int iResult;
+ INT_PTR iResult;
ENCODEDLG dd;
dd.bRecodeOnly = TRUE;
@@ -2168,7 +2152,7 @@ BOOL RecodeDlg(HWND hwnd,int *pidREncoding)
// IDC_CONSISTENTEOLS
// IDC_AUTOSTRIPBLANKS
//
-BOOL CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
static int *piOption;
@@ -2205,7 +2189,7 @@ BOOL CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
switch(LOWORD(wParam))
{
case IDOK: {
- *piOption = SendDlgItemMessage(hwnd,100,CB_GETCURSEL,0,0);
+ *piOption = (int)SendDlgItemMessage(hwnd,100,CB_GETCURSEL,0,0);
bFixLineEndings = (IsDlgButtonChecked(hwnd,IDC_CONSISTENTEOLS) == BST_CHECKED) ? 1 : 0;
bAutoStripBlanks = (IsDlgButtonChecked(hwnd,IDC_AUTOSTRIPBLANKS) == BST_CHECKED) ? 1 : 0;
EndDialog(hwnd,IDOK);
@@ -2229,7 +2213,7 @@ BOOL CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
BOOL SelectDefLineEndingDlg(HWND hwnd,int *iOption)
{
- int iResult;
+ INT_PTR iResult;
iResult = ThemedDialogBoxParam(
g_hInstance,
@@ -2254,7 +2238,7 @@ typedef struct _infobox {
BOOL bDisableCheckBox;
} INFOBOX, *LPINFOBOX;
-BOOL CALLBACK InfoBoxDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK InfoBoxDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
LPINFOBOX lpib;
@@ -2262,7 +2246,7 @@ BOOL CALLBACK InfoBoxDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
{
case WM_INITDIALOG:
lpib = (LPINFOBOX)lParam;
- SetWindowLongPtr(hwnd,DWLP_USER,lParam);
+ SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);
SendDlgItemMessage(hwnd,IDC_INFOBOXICON,STM_SETICON,
(WPARAM)LoadIcon(NULL,IDI_EXCLAMATION),0);
SetDlgItemText(hwnd,IDC_INFOBOXTEXT,lpib->lpstrMessage);
@@ -2298,15 +2282,18 @@ BOOL CALLBACK InfoBoxDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
//
extern WCHAR szIniFile[MAX_PATH];
-int InfoBox(int iType,LPCWSTR lpstrSetting,int uidMessage,...)
+INT_PTR InfoBox(int iType,LPCWSTR lpstrSetting,int uidMessage,...)
{
HWND hwnd;
int idDlg = IDD_INFOBOX;
INFOBOX ib;
WCHAR wchFormat[512];
+ int iMode;
- if (IniGetInt(L"Suppressed Messages",lpstrSetting,0))
+ iMode = IniGetInt(L"Suppressed Messages",lpstrSetting,0);
+
+ if (lstrlen(lpstrSetting) > 0 && iMode == 1)
return (iType == MBYESNO) ? IDYES : IDOK;
if (!GetString(uidMessage,wchFormat,COUNTOF(wchFormat)))
@@ -2314,10 +2301,8 @@ int InfoBox(int iType,LPCWSTR lpstrSetting,int uidMessage,...)
ib.lpstrMessage = LocalAlloc(LPTR,1024 * sizeof(WCHAR));
wvsprintf(ib.lpstrMessage,wchFormat,(LPVOID)((PUINT_PTR)&uidMessage + 1));
-
ib.lpstrSetting = (LPWSTR)lpstrSetting;
-
- ib.bDisableCheckBox = (lstrlen(szIniFile) == 0) ? TRUE : FALSE;
+ ib.bDisableCheckBox = (lstrlen(szIniFile) == 0 || lstrlen(lpstrSetting) == 0 || iMode == 2) ? TRUE : FALSE;
if (iType == MBYESNO)
idDlg = IDD_INFOBOX2;
View
8 src/Dialogs.h
@@ -11,7 +11,7 @@
*
* See License.txt for details about distribution and modification.
*
-* (c) Florian Balmer 1996-2010
+* (c) Florian Balmer 1996-2011
* florian.balmer@gmail.com
* http://www.flos-freeware.ch
*
@@ -26,10 +26,10 @@
#define MBYESNOCANCEL 4
#define MBOKCANCEL 8
-int MsgBox(int,UINT,...);
+int MsgBox(int,UINT,...);
void DisplayCmdLineHelp();
BOOL GetDirectory(HWND,int,LPWSTR,LPCWSTR,BOOL);
-BOOL CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
+INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
void RunDlg(HWND,LPCWSTR);
BOOL OpenWithDlg(HWND,LPCWSTR);
BOOL FavoritesDlg(HWND,LPWSTR);
@@ -44,7 +44,7 @@ BOOL SelectDefEncodingDlg(HWND,int *);
BOOL SelectEncodingDlg(HWND,int *);
BOOL RecodeDlg(HWND,int *);
BOOL SelectDefLineEndingDlg(HWND,int *);
-int InfoBox(int,LPCWSTR,int,...);
+INT_PTR InfoBox(int,LPCWSTR,int,...);
// End of Dialogs.h
View
523 src/Dlapi.c
@@ -11,7 +11,7 @@
*
* See License.txt for details about distribution and modification.
*
-* (c) Florian Balmer 1996-2010
+* (c) Florian Balmer 1996-2011
* florian.balmer@gmail.com
* http://www.flos-freeware.ch
*
@@ -27,11 +27,6 @@
-//==== Global LPMALLOC instance ===============================================
-extern LPMALLOC g_lpMalloc;
-
-
-
//==== DirList ================================================================
//==== DLDATA Structure =======================================================
@@ -126,8 +121,6 @@ BOOL DirList_Init(HWND hwnd,LPCWSTR pszHeader)
BOOL DirList_Destroy(HWND hwnd)
{
- //LPMALLOC lpMalloc;
-
LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
// Release multithreading objects
@@ -135,18 +128,11 @@ BOOL DirList_Destroy(HWND hwnd)
CloseHandle(lpdl->hExitThread);
CloseHandle(lpdl->hTerminatedThread);
- //if (NOERROR == SHGetMalloc(&lpMalloc))
- //{
-
- if (lpdl->pidl)
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdl->pidl);
-
- //lpMalloc->lpVtbl->Release(lpMalloc);
+ if (lpdl->pidl)
+ CoTaskMemFree(lpdl->pidl);
- if (lpdl->lpsf)
- lpdl->lpsf->lpVtbl->Release(lpdl->lpsf);
-
- //}
+ if (lpdl->lpsf)
+ lpdl->lpsf->lpVtbl->Release(lpdl->lpsf);
// Free DirListData Property
RemoveProp(hwnd,pDirListProp);
@@ -225,8 +211,6 @@ int DirList_Fill(HWND hwnd,LPCWSTR lpszDir,DWORD grfFlags,LPCWSTR lpszFileSpec,
WCHAR wszDir[MAX_PATH];
- //LPMALLOC lpMalloc = NULL;
-
LPSHELLFOLDER lpsfDesktop = NULL;
LPSHELLFOLDER lpsf = NULL;
@@ -289,119 +273,107 @@ int DirList_Fill(HWND hwnd,LPCWSTR lpszDir,DWORD grfFlags,LPCWSTR lpszFileSpec,
lstrcpy(wszDir,lpszDir);
- // Get Shell's IMalloc Interface
- //if (NOERROR == SHGetMalloc(&lpMalloc))
- //{
+ // Get Desktop Folder
+ if (NOERROR == SHGetDesktopFolder(&lpsfDesktop))
+ {
+
+ // Convert wszDir into a pidl
+ if (NOERROR == lpsfDesktop->lpVtbl->ParseDisplayName(
+ lpsfDesktop,
+ hwnd,
+ NULL,
+ wszDir,
+ &chParsed,
+ &pidl,
+ &dwAttributes))
- // Get Desktop Folder
- if (NOERROR == SHGetDesktopFolder(&lpsfDesktop))
{
- // Convert wszDir into a pidl
- if (NOERROR == lpsfDesktop->lpVtbl->ParseDisplayName(
+ // Bind pidl to IShellFolder
+ if (NOERROR == lpsfDesktop->lpVtbl->BindToObject(
lpsfDesktop,
- hwnd,
+ pidl,
NULL,
- wszDir,
- &chParsed,
- &pidl,
- &dwAttributes))
+ &IID_IShellFolder,
+ &lpsf))
{
- // Bind pidl to IShellFolder
- if (NOERROR == lpsfDesktop->lpVtbl->BindToObject(
- lpsfDesktop,
- pidl,
- NULL,
- &IID_IShellFolder,
- &lpsf))
+ // Create an Enumeration object for lpsf
+ if (NOERROR == lpsf->lpVtbl->EnumObjects(
+ lpsf,
+ hwnd,
+ grfFlags,
+ &lpe))
{
- // Create an Enumeration object for lpsf
- if (NOERROR == lpsf->lpVtbl->EnumObjects(
- lpsf,
- hwnd,
- grfFlags,
- &lpe))
+ // Enumerate the contents of lpsf
+ while (NOERROR == lpe->lpVtbl->Next(
+ lpe,
+ 1,
+ &pidlEntry,
+ NULL))
{
- // Enumerate the contents of lpsf
- while (NOERROR == lpe->lpVtbl->Next(
- lpe,
- 1,
- &pidlEntry,
- NULL))
-
- {
+ // Add found item to the List
+ // Check if it's part of the Filesystem
+ dwAttributes = SFGAO_FILESYSTEM | SFGAO_FOLDER;
- // Add found item to the List
- // Check if it's part of the Filesystem
- dwAttributes = SFGAO_FILESYSTEM | SFGAO_FOLDER;
+ lpsf->lpVtbl->GetAttributesOf(
+ lpsf,
+ 1,
+ &pidlEntry,
+ &dwAttributes);
- lpsf->lpVtbl->GetAttributesOf(
- lpsf,
- 1,
- &pidlEntry,
- &dwAttributes);
+ if (dwAttributes & SFGAO_FILESYSTEM)
+ {
- if (dwAttributes & SFGAO_FILESYSTEM)
+ // Check if item matches specified filter
+ if (DirList_MatchFilter(lpsf,pidlEntry,&dlf))
{
- // Check if item matches specified filter
- if (DirList_MatchFilter(lpsf,pidlEntry,&dlf))
- {
+ lplvid = CoTaskMemAlloc(sizeof(LV_ITEMDATA));
- lplvid = g_lpMalloc->lpVtbl->Alloc(
- g_lpMalloc,
- sizeof(LV_ITEMDATA));
+ lplvid->pidl = pidlEntry;
+ lplvid->lpsf = lpsf;
- lplvid->pidl = pidlEntry;
- lplvid->lpsf = lpsf;
+ lpsf->lpVtbl->AddRef(lpsf);
- lpsf->lpVtbl->AddRef(lpsf);
+ lvi.lParam = (LPARAM)lplvid;
- lvi.lParam = (LPARAM)lplvid;
+ // Setup default Icon - Folder or File
+ lvi.iImage = (dwAttributes & SFGAO_FOLDER) ?
+ lpdl->iDefIconFolder : lpdl->iDefIconFile;
- // Setup default Icon - Folder or File
- lvi.iImage = (dwAttributes & SFGAO_FOLDER) ?
- lpdl->iDefIconFolder : lpdl->iDefIconFile;
+ ListView_InsertItem(hwnd,&lvi);
- ListView_InsertItem(hwnd,&lvi);
-
- lvi.iItem++;
-
- }
+ lvi.iItem++;
}
- //lpMalloc->lpVtbl->Free(lpMalloc,pidlEntry);
-
- } // IEnumIDList::Next()
-
- lpe->lpVtbl->Release(lpe);
+ }
- } // IShellFolder::EnumObjects()
+ } // IEnumIDList::Next()
- } // IShellFolder::BindToObject()
+ lpe->lpVtbl->Release(lpe);
- } // IShellFolder::ParseDisplayName()
+ } // IShellFolder::EnumObjects()
- lpsfDesktop->lpVtbl->Release(lpsfDesktop);
+ } // IShellFolder::BindToObject()
- } // SHGetDesktopFolder()
+ } // IShellFolder::ParseDisplayName()
- if (lpdl->pidl)
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdl->pidl);
+ lpsfDesktop->lpVtbl->Release(lpsfDesktop);
- if (lpdl->lpsf && lpdl->lpsf->lpVtbl)
- lpdl->lpsf->lpVtbl->Release(lpdl->lpsf);
+ } // SHGetDesktopFolder()
- //lpMalloc->lpVtbl->Release(lpMalloc);
+ if (lpdl->pidl)
+ CoTaskMemFree(lpdl->pidl);
- //} // SHGetMalloc()
+ if (lpdl->lpsf && lpdl->lpsf->lpVtbl)
+ lpdl->lpsf->lpVtbl->Release(lpdl->lpsf);
// Set lpdl
lpdl->cbidl = IL_GetSize(pidl);
@@ -439,7 +411,6 @@ DWORD WINAPI DirList_IconThread(LPVOID lpParam)
LV_ITEM lvi;
LPLV_ITEMDATA lplvid;
- LPMALLOC lpMalloc;
IShellIcon* lpshi;
int iItem = 0;
@@ -459,7 +430,6 @@ DWORD WINAPI DirList_IconThread(LPVOID lpParam)
iMaxItem = ListView_GetItemCount(hwnd);
CoInitialize(NULL);
- SHGetMalloc(&lpMalloc);
// Get IShellIcon
lpdl->lpsf->lpVtbl->QueryInterface(lpdl->lpsf,&IID_IShellIcon,&lpshi);
@@ -480,9 +450,9 @@ DWORD WINAPI DirList_IconThread(LPVOID lpParam)
if (!lpshi || NOERROR != lpshi->lpVtbl->GetIconOf(lpshi,lplvid->pidl,GIL_FORSHELL,&lvi.iImage))
{
- pidl = IL_Create(lpMalloc,lpdl->pidl,lpdl->cbidl,lplvid->pidl,0);
+ pidl = IL_Create(lpdl->pidl,lpdl->cbidl,lplvid->pidl,0);
SHGetFileInfo((LPCWSTR)pidl,0,&shfi,sizeof(SHFILEINFO),SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
- lpMalloc->lpVtbl->Free(lpMalloc,pidl);
+ CoTaskMemFree(pidl);
lvi.iImage = shfi.iIcon;
}
@@ -535,7 +505,6 @@ DWORD WINAPI DirList_IconThread(LPVOID lpParam)
if (lpshi)
lpshi->lpVtbl->Release(lpshi);
- lpMalloc->lpVtbl->Release(lpMalloc);
CoUninitialize();
SetEvent(lpdl->hTerminatedThread);
@@ -555,8 +524,6 @@ DWORD WINAPI DirList_IconThread(LPVOID lpParam)
BOOL DirList_GetDispInfo(HWND hwnd,LPARAM lParam,BOOL bNoFadeHidden)
{
- LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
-
LV_DISPINFO *lpdi = (LPVOID)lParam;
LPLV_ITEMDATA lplvid = (LPLV_ITEMDATA)lpdi->item.lParam;
@@ -570,74 +537,6 @@ BOOL DirList_GetDispInfo(HWND hwnd,LPARAM lParam,BOOL bNoFadeHidden)
IL_GetDisplayName(lplvid->lpsf,lplvid->pidl,SHGDN_INFOLDER,
lpdi->item.pszText,lpdi->item.cchTextMax);
- // Image
- //if (lpdi->item.mask & LVIF_IMAGE)
- //{
-
- // //LPMALLOC lpMalloc;
- // SHFILEINFO shfi;
- // LPITEMIDLIST pidl;
- // DWORD dwAttributes = SFGAO_LINK | SFGAO_SHARE;
-
- // //if (NOERROR == SHGetMalloc(&lpMalloc))
- // //{
-
- // // Generate Full Qualified pidl
- // pidl = IL_Create(g_lpMalloc,lpdl->pidl,lpdl->cbidl,lplvid->pidl,0);
-
- // SHGetFileInfo((LPCWSTR)pidl,0,&shfi,sizeof(SHFILEINFO),SHGFI_PIDL | SHGFI_SYSICONINDEX);
-
- // lpdi->item.iImage = shfi.iIcon;
-
- // g_lpMalloc->lpVtbl->Free(g_lpMalloc,pidl);
- // //lpMalloc->lpVtbl->Release(lpMalloc);
-
- // //}
-
- // // It proved necessary to reset the state bits...
- // lpdi->item.stateMask = 0;
- // lpdi->item.state = 0;
-
- // // Link and Share Overlay
- // lplvid->lpsf->lpVtbl->GetAttributesOf(
- // lplvid->lpsf,
- // 1,&lplvid->pidl,
- // &dwAttributes);
-
- // if (dwAttributes & SFGAO_LINK)
- // {
- // lpdi->item.mask |= LVIF_STATE;
- // lpdi->item.stateMask |= LVIS_OVERLAYMASK;
- // lpdi->item.state |= INDEXTOOVERLAYMASK(2);
- // }
-
- // if (dwAttributes & SFGAO_SHARE)
- // {
- // lpdi->item.mask |= LVIF_STATE;
- // lpdi->item.stateMask |= LVIS_OVERLAYMASK;
- // lpdi->item.state |= INDEXTOOVERLAYMASK(1);
- // }
-
- // // Fade hidden/system files
- // if (!bNoFadeHidden)
- // {
- // WIN32_FIND_DATA fd;
- // if (NOERROR == SHGetDataFromIDList(lplvid->lpsf,lplvid->pidl,
- // SHGDFIL_FINDDATA,&fd,sizeof(WIN32_FIND_DATA)))
- // {
- // if ((fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) ||
- // (fd.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM))
- // {
- // lpdi->item.mask |= LVIF_STATE;
- // lpdi->item.stateMask |= LVIS_CUT;
- // lpdi->item.state |= LVIS_CUT;
- // }
- // }
-
- // }
-
- //}
-
// Set values
lpdi->item.mask |= LVIF_DI_SETITEM;
@@ -656,10 +555,7 @@ BOOL DirList_GetDispInfo(HWND hwnd,LPARAM lParam,BOOL bNoFadeHidden)
BOOL DirList_DeleteItem(HWND hwnd,LPARAM lParam)
{
- LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
-
LV_ITEM lvi;
- //LPMALLOC lpMalloc;
NM_LISTVIEW *lpnmlv = (LPVOID)lParam;
@@ -670,21 +566,14 @@ BOOL DirList_DeleteItem(HWND hwnd,LPARAM lParam)
if (ListView_GetItem(hwnd,&lvi))
{
- //if (NOERROR == SHGetMalloc(&lpMalloc))
- //{
-
- // Free mem
- LPLV_ITEMDATA lplvid = (LPLV_ITEMDATA)lvi.lParam;
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,lplvid->pidl);
- lplvid->lpsf->lpVtbl->Release(lplvid->lpsf);
-
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,lplvid);
+ // Free mem
+ LPLV_ITEMDATA lplvid = (LPLV_ITEMDATA)lvi.lParam;
+ CoTaskMemFree(lplvid->pidl);
+ lplvid->lpsf->lpVtbl->Release(lplvid->lpsf);
- //lpMalloc->lpVtbl->Release(lpMalloc);
+ CoTaskMemFree(lplvid);
- return TRUE;
-
- //}
+ return TRUE;
}
@@ -774,14 +663,10 @@ int CALLBACK DirList_CompareProcRw(LPARAM lp1,LPARAM lp2,LPARAM lFlags)
BOOL DirList_Sort(HWND hwnd,int lFlags,BOOL fRev)
{
- LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp);
-
if (fRev)
-
return ListView_SortItems(hwnd,DirList_CompareProcRw,lFlags);
else
-
return ListView_SortItems(hwnd,DirList_CompareProcFw,lFlags);
}
@@ -995,56 +880,6 @@ BOOL DirList_PropertyDlg(HWND hwnd,int iItem)
//=============================================================================
//
-// DirList_DoDragDrop()
-//
-// Execute an OLE Drag & Drop Operation in response to LVN_BEGIN(R)DRAG
-//
-//extern LPDROPSOURCE CreateDropSource();
-
-void DirList_DoDragDrop(HWND hwnd,LPARAM lParam)
-{
-
- //LV_ITEM lvi;
- //LPLV_ITEMDATA lplvid;
- //LPDATAOBJECT lpdo;
- //LPDROPSOURCE lpds;
- //DWORD dwEffect;
- //NM_LISTVIEW *pnmlv = (LPVOID)lParam;
-
- //lvi.iItem = pnmlv->iItem;
- //lvi.iSubItem = 0;
- //lvi.mask = LVIF_PARAM;
-
- //if (ListView_GetItem(hwnd,&lvi))
- //{
-
- // lplvid = (LPLV_ITEMDATA)lvi.lParam;
-
- // if (SUCCEEDED(lplvid->lpsf->lpVtbl->GetUIObjectOf(
- // lplvid->lpsf,
- // GetParent(hwnd),
- // 1,
- // &lplvid->pidl,
- // &IID_IDataObject,
- // NULL,
- // &lpdo)))
- // {
-
- // lpds = CreateDropSource();
-
- // DoDragDrop(lpdo,lpds,DROPEFFECT_COPY|DROPEFFECT_MOVE|DROPEFFECT_LINK,&dwEffect);
-
- // lpdo->lpVtbl->Release(lpdo);
- // lpds->lpVtbl->Release(lpds);
-
- // }
- //}
-}
-
-
-
-//=============================================================================
-//
// DirList_GetLongPathName()
//
// Get long pathname for currently displayed directory
@@ -1247,8 +1082,6 @@ BOOL DriveBox_Init(HWND hwnd)
int DriveBox_Fill(HWND hwnd)
{
- //LPMALLOC lpMalloc;
-
LPSHELLFOLDER lpsfDesktop;
LPSHELLFOLDER lpsf; // Workspace == CSIDL_DRIVES
@@ -1276,141 +1109,130 @@ int DriveBox_Fill(HWND hwnd)
cbei.iImage = I_IMAGECALLBACK;
cbei.iSelectedImage = I_IMAGECALLBACK;
- // Get Shell's IMalloc Interface
- //if (NOERROR == SHGetMalloc(&lpMalloc))
- //{
- // Get pidl to [My Computer]
- if (NOERROR == SHGetSpecialFolderLocation(hwnd,
- CSIDL_DRIVES,
- &pidl))
+ // Get pidl to [My Computer]
+ if (NOERROR == SHGetSpecialFolderLocation(hwnd,
+ CSIDL_DRIVES,
+ &pidl))
+ {
+
+ // Get Desktop Folder
+ if (NOERROR == SHGetDesktopFolder(&lpsfDesktop))
{
- // Get Desktop Folder
- if (NOERROR == SHGetDesktopFolder(&lpsfDesktop))
+ // Bind pidl to IShellFolder
+ if (NOERROR == lpsfDesktop->lpVtbl->BindToObject(
+ lpsfDesktop,
+ pidl,
+ NULL,
+ &IID_IShellFolder,
+ &lpsf))
+
{
- // Bind pidl to IShellFolder
- if (NOERROR == lpsfDesktop->lpVtbl->BindToObject(
- lpsfDesktop,
- pidl,
- NULL,
- &IID_IShellFolder,
- &lpsf))
+ // Create an Enumeration object for lpsf
+ if (NOERROR == lpsf->lpVtbl->EnumObjects(
+ lpsf,
+ hwnd,
+ grfFlags,
+ &lpe))
{
- // Create an Enumeration object for lpsf
- if (NOERROR == lpsf->lpVtbl->EnumObjects(
- lpsf,
- hwnd,
- grfFlags,
- &lpe))
+ // Enumerate the contents of [My Computer]
+ while (NOERROR == lpe->lpVtbl->Next(
+ lpe,
+ 1,
+ &pidlEntry,
+ NULL))
{
- // Enumerate the contents of [My Computer]
- while (NOERROR == lpe->lpVtbl->Next(
- lpe,
- 1,
- &pidlEntry,
- NULL))
-
- {
+ // Add item to the List if it is part of the
+ // Filesystem
+ dwAttributes = SFGAO_FILESYSTEM;
- // Add item to the List if it is part of the
- // Filesystem
- dwAttributes = SFGAO_FILESYSTEM;
+ lpsf->lpVtbl->GetAttributesOf(
+ lpsf,
+ 1,
+ &pidlEntry,
+ &dwAttributes);
- lpsf->lpVtbl->GetAttributesOf(
- lpsf,
- 1,
- &pidlEntry,
- &dwAttributes);
+ if (dwAttributes & SFGAO_FILESYSTEM)
+ {
- if (dwAttributes & SFGAO_FILESYSTEM)
+ // Windows XP: check if pidlEntry is a drive
+ SHDESCRIPTIONID di;
+ HRESULT hr;
+ hr = SHGetDataFromIDList(lpsf,pidlEntry,SHGDFIL_DESCRIPTIONID,
+ &di,sizeof(SHDESCRIPTIONID));
+ if (hr != NOERROR || (di.dwDescriptionId >= SHDID_COMPUTER_DRIVE35 &&
+ di.dwDescriptionId <= SHDID_COMPUTER_OTHER))
{
- // Windows XP: check if pidlEntry is a drive
- SHDESCRIPTIONID di;
- HRESULT hr;
- hr = SHGetDataFromIDList(lpsf,pidlEntry,SHGDFIL_DESCRIPTIONID,
- &di,sizeof(SHDESCRIPTIONID));
- if (hr != NOERROR || (di.dwDescriptionId >= SHDID_COMPUTER_DRIVE35 &&
- di.dwDescriptionId <= SHDID_COMPUTER_OTHER))
- {
+ lpdcid = CoTaskMemAlloc(sizeof(DC_ITEMDATA));
- lpdcid = g_lpMalloc->lpVtbl->Alloc(
- g_lpMalloc,
- sizeof(DC_ITEMDATA));
+ //lpdcid->pidl = IL_Copy(pidlEntry);
+ lpdcid->pidl = pidlEntry;
+ lpdcid->lpsf = lpsf;
- //lpdcid->pidl = IL_Copy(lpMalloc,pidlEntry);
- lpdcid->pidl = pidlEntry;
- lpdcid->lpsf = lpsf;
+ lpsf->lpVtbl->AddRef(lpsf);
- lpsf->lpVtbl->AddRef(lpsf);
+ // Insert sorted ...
+ {
+ COMBOBOXEXITEM cbei2;
+ LPDC_ITEMDATA lpdcid2;
+ HRESULT hr;
+ cbei2.mask = CBEIF_LPARAM;
+ cbei2.iItem = 0;
- // Insert sorted ...
+ while ((SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei2)))
{
- COMBOBOXEXITEM cbei2;
- LPDC_ITEMDATA lpdcid2;
- HRESULT hr;
- cbei2.mask = CBEIF_LPARAM;
- cbei2.iItem = 0;
-
- while ((SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei2)))
- {
- lpdcid2 = (LPDC_ITEMDATA)cbei2.lParam;
- hr = (lpdcid->lpsf->lpVtbl->CompareIDs(
- lpdcid->lpsf,
- 0,
- lpdcid->pidl,
- lpdcid2->pidl));
-
- if ((short)(SCODE_CODE(GetScode(hr))) < 0)
- break;
- else
- cbei2.iItem++;
- }
-
- cbei.iItem = cbei2.iItem;
- cbei.lParam = (LPARAM)lpdcid;
- SendMessage(hwnd,CBEM_INSERTITEM,0,(LPARAM)&cbei);
-
+ lpdcid2 = (LPDC_ITEMDATA)cbei2.lParam;
+ hr = (lpdcid->lpsf->lpVtbl->CompareIDs(
+ lpdcid->lpsf,
+ 0,
+ lpdcid->pidl,
+ lpdcid2->pidl));
+
+ if ((short)(SCODE_CODE(GetScode(hr))) < 0)
+ break;
+ else
+ cbei2.iItem++;
}
+ cbei.iItem = cbei2.iItem;
+ cbei.lParam = (LPARAM)lpdcid;
+ SendMessage(hwnd,CBEM_INSERTITEM,0,(LPARAM)&cbei);
+
}
}
- //lpMalloc->lpVtbl->Free(lpMalloc,pidlEntry);
-
- } // IEnumIDList::Next()
-
- lpe->lpVtbl->Release(lpe);
+ }
- } // IShellFolder::EnumObjects()
+ } // IEnumIDList::Next()
- lpsf->lpVtbl->Release(lpsf);
+ lpe->lpVtbl->Release(lpe);
- } // IShellFolder::BindToObject()
+ } // IShellFolder::EnumObjects()
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,pidl);
+ lpsf->lpVtbl->Release(lpsf);
- } // SHGetSpecialFolderLocation()
+ } // IShellFolder::BindToObject()
- lpsfDesktop->lpVtbl->Release(lpsfDesktop);
+ CoTaskMemFree(pidl);
- } // SHGetDesktopFolder()
+ } // SHGetSpecialFolderLocation()
- //lpMalloc->lpVtbl->Release(lpMalloc);
+ lpsfDesktop->lpVtbl->Release(lpsfDesktop);
- //} // SHGetMalloc()
+ } // SHGetDesktopFolder()
SendMessage(hwnd,WM_SETREDRAW,1,0);
// Return number of items added to combo box
- return (SendMessage(hwnd,CB_GETCOUNT,0,0));
+ return ((int)SendMessage(hwnd,CB_GETCOUNT,0,0));
}
@@ -1424,7 +1246,7 @@ BOOL DriveBox_GetSelDrive(HWND hwnd,LPWSTR lpszDrive,int nDrive,BOOL fNoSlash)
COMBOBOXEXITEM cbei;
LPDC_ITEMDATA lpdcid;
- int i = SendMessage(hwnd,CB_GETCURSEL,0,0);
+ int i = (int)SendMessage(hwnd,CB_GETCURSEL,0,0);
// CB_ERR means no Selection
if (i == CB_ERR)
@@ -1460,7 +1282,7 @@ BOOL DriveBox_SelectDrive(HWND hwnd,LPCWSTR lpszPath)
WCHAR szRoot[64];
int i;
- int cbItems = SendMessage(hwnd,CB_GETCOUNT,0,0);
+ int cbItems = (int)SendMessage(hwnd,CB_GETCOUNT,0,0);
// No Drives in Combo Box
if (!cbItems)
@@ -1512,7 +1334,7 @@ BOOL DriveBox_PropertyDlg(HWND hwnd)
static const char *lpVerb = "properties";
- iItem = SendMessage(hwnd,CB_GETCURSEL,0,0);
+ iItem = (int)SendMessage(hwnd,CB_GETCURSEL,0,0);
if (iItem == CB_ERR)
return FALSE;
@@ -1564,7 +1386,6 @@ BOOL DriveBox_PropertyDlg(HWND hwnd)
LRESULT DriveBox_DeleteItem(HWND hwnd,LPARAM lParam)
{
- //LPMALLOC lpMalloc;
NMCOMBOBOXEX *lpnmcbe;
COMBOBOXEXITEM cbei;
LPDC_ITEMDATA lpdcid;
@@ -1576,18 +1397,13 @@ LRESULT DriveBox_DeleteItem(HWND hwnd,LPARAM lParam)
SendMessage(hwnd,CBEM_GETITEM,0,(LPARAM)&cbei);
lpdcid = (LPDC_ITEMDATA)cbei.lParam;
- //SHGetMalloc(&lpMalloc);
-
// Free pidl
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdcid->pidl);
+ CoTaskMemFree(lpdcid->pidl);
// Release lpsf
lpdcid->lpsf->lpVtbl->Release(lpdcid->lpsf);
// Free lpdcid itself
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,lpdcid);
-
- // Release lpMalloc
- //lpMalloc->lpVtbl->Release(lpMalloc);
+ CoTaskMemFree(lpdcid);
return TRUE;
@@ -1647,8 +1463,7 @@ LRESULT DriveBox_GetDispInfo(HWND hwnd,LPARAM lParam)
// If cb2 is zero, the size of pidl2 is retrieved using
// IL_GetSize(pidl2)
//
-LPITEMIDLIST IL_Create(LPMALLOC lpMalloc,
- LPCITEMIDLIST pidl1,UINT cb1,
+LPITEMIDLIST IL_Create(LPCITEMIDLIST pidl1,UINT cb1,
LPCITEMIDLIST pidl2,UINT cb2)
{
@@ -1664,7 +1479,7 @@ LPITEMIDLIST IL_Create(LPMALLOC lpMalloc,
cb1 = IL_GetSize(pidl1);
// Allocate Memory
- pidl = lpMalloc->lpVtbl->Alloc(lpMalloc,cb1 + cb2);
+ pidl = CoTaskMemAlloc(cb1 + cb2);
// Init new ITEMIDLIST
if (pidl1)
@@ -1743,7 +1558,7 @@ BOOL IL_GetDisplayName(LPSHELLFOLDER lpsf,
nDisplayName,
NULL,
NULL);
- g_lpMalloc->lpVtbl->Free(g_lpMalloc,str.pOleStr);
+ CoTaskMemFree(str.pOleStr);
break;
case STRRET_OFFSET:
View
13 src/Dlapi.h
@@ -11,7 +11,7 @@
*
* See License.txt for details about distribution and modification.
*
-* (c) Florian Balmer 1996-2010
+* (c) Florian Balmer 1996-2011
* florian.balmer@gmail.com
* http://www.flos-freeware.ch
*
@@ -22,7 +22,7 @@
#define _DLAPI_H_
#ifdef __cplusplus
-extern L"C" { // C-Declarations
+extern "C" { // C-Declarations
#endif //__cplusplus
@@ -114,7 +114,7 @@ typedef struct tagDLITEM // dli
} DLITEM, *LPDLITEM;
-DirList_GetItem(HWND,int,LPDLITEM);
+int DirList_GetItem(HWND,int,LPDLITEM);
//==== DlGetItemEx() ==========================================================
@@ -127,10 +127,6 @@ int DirList_GetItemEx(HWND,int,LPWIN32_FIND_DATA);
BOOL DirList_PropertyDlg(HWND,int);
-//==== DlDoDragDrop() =========================================================
-
-void DirList_DoDragDrop(HWND,LPARAM);
-
//==== DlGetLongPathName() ====================================================
BOOL DirList_GetLongPathName(HWND,LPWSTR);
@@ -175,8 +171,7 @@ LRESULT DriveBox_GetDispInfo(HWND,LPARAM);
#define _IL_Next(pidl) ((LPITEMIDLIST)(((LPBYTE)(pidl)) + pidl->mkid.cb))
//==== IL_Create() ============================================================
-LPITEMIDLIST IL_Create(LPMALLOC,
- LPCITEMIDLIST,UINT,
+LPITEMIDLIST IL_Create(LPCITEMIDLIST,UINT,
LPCITEMIDLIST,UINT);
//==== IL_GetSize() ===========================================================
View
2,298 src/Edit.c
1,605 additions, 693 deletions not shown
View
43 src/Edit.h
@@ -11,7 +11,7 @@
*
* See License.txt for details about distribution and modification.
*
-* (c) Florian Balmer 1996-2010
+* (c) Florian Balmer 1996-2011
* florian.balmer@gmail.com
* http://www.flos-freeware.ch
*
@@ -21,7 +21,7 @@
// extern "C" declarations of Scintilla functions
-BOOL Scintilla_RegisterClasses(HINSTANCE);
+BOOL Scintilla_RegisterClasses(void*);
BOOL Scintilla_ReleaseResources();
@@ -44,14 +44,26 @@ typedef struct _editfindreplace
} EDITFINDREPLACE, *LPEDITFINDREPLACE, *LPCEDITFINDREPLACE;
-#define IDMSG_SWITCHTOFIND 204
-#define IDMSG_SWITCHTOREPLACE 205
+#define IDMSG_SWITCHTOFIND 300
+#define IDMSG_SWITCHTOREPLACE 301
+
+
+#define ALIGN_LEFT 0
+#define ALIGN_RIGHT 1
+#define ALIGN_CENTER 2
+#define ALIGN_JUSTIFY 3
+#define ALIGN_JUSTIFY_EX 4
#define SORT_ASCENDING 0
#define SORT_DESCENDING 1
-#define SORT_UNIQ 2
-#define SORT_LOGICAL 4
+#define SORT_SHUFFLE 2
+#define SORT_MERGEDUP 4
+#define SORT_UNIQDUP 8
+#define SORT_UNIQUNIQ 16
+#define SORT_NOCASE 32
+#define SORT_LOGICAL 64
+#define SORT_COLUMN 128
HWND EditCreate(HWND);
@@ -64,8 +76,6 @@ int EditDetectEOLMode(HWND,char*,DWORD);
BOOL EditLoadFile(HWND,LPCWSTR,BOOL,int*,int*,BOOL*,BOOL*);
BOOL EditSaveFile(HWND,LPCWSTR,int,BOOL*,BOOL);
-void EditMakeUppercase(HWND);
-void EditMakeLowercase(HWND);
void EditInvertCase(HWND);
void EditTitleCase(HWND);
void EditSentenceCase(HWND);
@@ -74,6 +84,8 @@ void EditURLEncode(HWND);
void EditURLDecode(HWND);
void EditEscapeCChars(HWND);
void EditUnescapeCChars(HWND);
+void EditChar2Hex(HWND);
+void EditHex2Char(HWND);
void EditModifyNumber(HWND,BOOL);
void EditTabsToSpaces(HWND,int,BOOL);
@@ -82,9 +94,10 @@ void EditSpacesToTabs(HWND,int,BOOL);
void EditMoveUp(HWND);
void EditMoveDown(HWND);
void EditModifyLines(HWND,LPCWSTR,LPCWSTR);
+void EditAlignText(HWND,int);