Merge pull request #47 from RaiKoHoff/Sandbox

fixing issue #35  and feature request #48
This commit is contained in:
Derick Payne 2017-08-12 19:14:20 +02:00 committed by GitHub
commit 33a09f77ac
12 changed files with 321 additions and 47 deletions

View File

@ -11,6 +11,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minipath", "minipath\minipa
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Scintilla", "scintilla\Scintilla_VS2017.vcxproj", "{5877B917-512B-49F5-B514-1B4159E7A9CA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "np3encrypt", "np3encrypt\np3encrypt_VS2017.vcxproj", "{0210F830-26C6-40FC-BFD1-6ED833B90830}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -27,14 +29,6 @@ Global
{BAAD32AB-CD47-12FD-873C-0BBC204B7641}.Release|Win32.Build.0 = Release|Win32
{BAAD32AB-CD47-12FD-873C-0BBC204B7641}.Release|x64.ActiveCfg = Release|x64
{BAAD32AB-CD47-12FD-873C-0BBC204B7641}.Release|x64.Build.0 = Release|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|Win32.ActiveCfg = Debug|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|Win32.Build.0 = Debug|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|x64.ActiveCfg = Debug|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|x64.Build.0 = Debug|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|Win32.ActiveCfg = Release|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|Win32.Build.0 = Release|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|x64.ActiveCfg = Release|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|x64.Build.0 = Release|x64
{781B17E7-427F-488F-A8E9-360BA38A10F3}.Debug|Win32.ActiveCfg = Debug|Win32
{781B17E7-427F-488F-A8E9-360BA38A10F3}.Debug|Win32.Build.0 = Debug|Win32
{781B17E7-427F-488F-A8E9-360BA38A10F3}.Debug|Win32.Deploy.0 = Debug|Win32
@ -47,6 +41,22 @@ Global
{781B17E7-427F-488F-A8E9-360BA38A10F3}.Release|x64.ActiveCfg = Release|x64
{781B17E7-427F-488F-A8E9-360BA38A10F3}.Release|x64.Build.0 = Release|x64
{781B17E7-427F-488F-A8E9-360BA38A10F3}.Release|x64.Deploy.0 = Release|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|Win32.ActiveCfg = Debug|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|Win32.Build.0 = Debug|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|x64.ActiveCfg = Debug|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Debug|x64.Build.0 = Debug|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|Win32.ActiveCfg = Release|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|Win32.Build.0 = Release|Win32
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|x64.ActiveCfg = Release|x64
{5877B917-512B-49F5-B514-1B4159E7A9CA}.Release|x64.Build.0 = Release|x64
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Debug|Win32.ActiveCfg = Debug|Win32
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Debug|Win32.Build.0 = Debug|Win32
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Debug|x64.ActiveCfg = Debug|x64
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Debug|x64.Build.0 = Debug|x64
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Release|Win32.ActiveCfg = Release|Win32
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Release|Win32.Build.0 = Release|Win32
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Release|x64.ActiveCfg = Release|x64
{0210F830-26C6-40FC-BFD1-6ED833B90830}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -583,8 +583,8 @@ INT_PTR CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
hFontTitle = GetStockObject(DEFAULT_GUI_FONT);
GetObject(hFontTitle,sizeof(LOGFONT),&lf);
lf.lfWeight = FW_BOLD;
lf.lfWidth = 8;
lf.lfHeight = 22;
lf.lfWidth = 8;
lf.lfHeight = 22;
hFontTitle = CreateFontIndirect(&lf);
SendDlgItemMessage(hwnd,IDC_VERSION,WM_SETFONT,(WPARAM)hFontTitle,TRUE);
@ -1246,7 +1246,7 @@ INT_PTR CALLBACK ProgPageProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam)
extern HWND hwndStatus;
extern int nIdFocus;
extern WCHAR tchFilter[128];
extern WCHAR tchFilter[DL_FILTER_BUFSIZE];
extern BOOL bNegFilter;
INT_PTR OptionsPropSheet(HWND hwnd,HINSTANCE hInstance)

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{0210F830-26C6-40FC-BFD1-6ED833B90830}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>np3encrypt</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>np3encrypt</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\</OutDir>
<IntDir>..\Bin\$(Configuration)_$(PlatformShortName)_$(PlatformToolset)\obj\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\crypto\crypto.h" />
<ClInclude Include="..\crypto\rijndael-alg-fst.h" />
<ClInclude Include="..\crypto\rijndael-api-fst.h" />
<ClInclude Include="..\crypto\sha-256.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\crypto\notepadcrypt.c" />
<ClCompile Include="..\crypto\rijndael-alg-fst.c" />
<ClCompile Include="..\crypto\rijndael-api-fst.c" />
<ClCompile Include="..\crypto\sha-256.c" />
<ClCompile Include="np3encrypt.cpp" />
<ClCompile Include="stdafx.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Quelldateien">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Headerdateien">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Ressourcendateien">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="crypto">
<UniqueIdentifier>{3f9cf2f1-2454-45d8-a2ed-02e3a66581e8}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\crypto\crypto.h">
<Filter>crypto</Filter>
</ClInclude>
<ClInclude Include="..\crypto\rijndael-alg-fst.h">
<Filter>crypto</Filter>
</ClInclude>
<ClInclude Include="..\crypto\rijndael-api-fst.h">
<Filter>crypto</Filter>
</ClInclude>
<ClInclude Include="..\crypto\sha-256.h">
<Filter>crypto</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="np3encrypt.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="..\crypto\rijndael-alg-fst.c">
<Filter>crypto</Filter>
</ClCompile>
<ClCompile Include="..\crypto\rijndael-api-fst.c">
<Filter>crypto</Filter>
</ClCompile>
<ClCompile Include="..\crypto\sha-256.c">
<Filter>crypto</Filter>
</ClCompile>
<ClCompile Include="..\crypto\notepadcrypt.c">
<Filter>crypto</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -2180,7 +2180,7 @@ INT_PTR CALLBACK SelectDefLineEndingDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LP
case WM_INITDIALOG:
{
int i;
WCHAR wch[128];
WCHAR wch[256];
piOption = (int*)lParam;

View File

@ -4829,7 +4829,7 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
static BOOL bFirstTime = TRUE;
#endif
WCHAR tch[128];
WCHAR tch[256];
HMENU hmenu;
SetWindowLongPtr(hwnd,DWLP_USER,(LONG_PTR)lParam);

View File

@ -381,11 +381,11 @@ BOOL SetWindowTitle(HWND hwnd,UINT uIDAppName,BOOL bIsElevated,UINT uIDUntitled,
UINT uIDReadOnly,BOOL bReadOnly,LPCWSTR lpszExcerpt)
{
WCHAR szUntitled[128];
WCHAR szUntitled[256];
WCHAR szExcrptQuot[256];
WCHAR szExcrptFmt[32];
WCHAR szAppName[128];
WCHAR szElevatedAppName[128];
WCHAR szAppName[256];
WCHAR szElevatedAppName[256];
WCHAR szReadOnly[32];
WCHAR szTitle[512];
static WCHAR szCachedFile[MAX_PATH];

View File

@ -252,7 +252,7 @@ BOOL bLastCopyFromMe = FALSE;
DWORD dwLastCopyTime;
UINT uidsAppTitle = IDS_APPTITLE;
WCHAR szTitleExcerpt[128] = L"";
WCHAR szTitleExcerpt[256] = { L'\0' };
int fKeepTitleExcerpt = 0;
HANDLE hChangeHandle = NULL;
@ -407,7 +407,7 @@ int flagQuietCreate = 0;
int flagUseSystemMRU = 0;
int flagRelaunchElevated = 0;
int flagDisplayHelp = 0;
int flagPrintFileAndLeave = 0;
//==============================================================================
@ -938,7 +938,7 @@ HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow)
}
else {
if (iSrcEncoding != -1) {
if (iSrcEncoding != CPI_NONE) {
iEncoding = iSrcEncoding;
iOriginalEncoding = iSrcEncoding;
SendMessage(hwndEdit,SCI_SETCODEPAGE,Encoding_GetSciCodePage(iEncoding),0);
@ -1051,8 +1051,32 @@ HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow)
UpdateToolbar();
UpdateStatusbar();
return(hwndMain);
// print file immediately and quit
if (flagPrintFileAndLeave)
{
SHFILEINFO shfi;
WCHAR *pszTitle;
WCHAR tchUntitled[32];
WCHAR tchPageFmt[32];
if (lstrlen(szCurFile)) {
SHGetFileInfo2(szCurFile, 0, &shfi, sizeof(SHFILEINFO), SHGFI_DISPLAYNAME);
pszTitle = shfi.szDisplayName;
}
else {
GetString(IDS_UNTITLED, tchUntitled, COUNTOF(tchUntitled));
pszTitle = tchUntitled;
}
GetString(IDS_PRINT_PAGENUM, tchPageFmt, COUNTOF(tchPageFmt));
if (!EditPrint(hwndEdit, pszTitle, tchPageFmt))
MsgBox(MBWARN, IDS_PRINT_ERROR, pszTitle);
PostMessage(hwndMain, WM_CLOSE, 0, 0);
}
return(hwndMain);
}
@ -6407,6 +6431,12 @@ void ParseCommandLine()
flagDisplayHelp = 1;
break;
case L'V':
flagPrintFileAndLeave = 1;
if (*CharUpper(lp1 + 1) == L'D')
flagPrintFileAndLeave = 2; // open printer dialog
break;
default:
break;
@ -7843,7 +7873,7 @@ void SetNotifyIconTitle(HWND hwnd)
NOTIFYICONDATA nid;
SHFILEINFO shfi;
WCHAR tchTitle[128];
WCHAR tchTitle[256];
WCHAR tchFormat[32];
ZeroMemory(&nid,sizeof(NOTIFYICONDATA));

View File

@ -1437,7 +1437,7 @@ END
STRINGTABLE
BEGIN
IDS_CMDLINEHELP "Command Line Help\n\nfile\tMust be the last argument, no quoted spaces by default.\n+\tAccept multiple file arguments (with quoted spaces).\n-\tAccept single file argument (without quoted spaces).\n…\tEncoding (/ansi, /unicode, /unicodebe, /utf8, /utf8sig).\n…\tLine ending mode (/crlf, /lf, /cr).\n/e\tFile source encoding.\n/g\tJump to specified position (/g -1 end of file).\n/m\tMatch specified text (/m- last, /mr regex, /mb backslash).\n/l\tAuto-reload modified files.\n/q\tForce creation of new files without prompt.\n/s\tSelect specified syntax scheme.\n/d\tSelect default text scheme.\n/h\tSelect Web Source Code scheme.\n/x\tSelect XML Document scheme.\n/c\tOpen new window and paste clipboard contents.\n/b\tOpen new paste board to collect clipboard entries.\n/n\tAlways open a new window (/ns single file instance).\n/r\tReuse window (/rs single file instance).\n/p\tSet window position and size (/p0, /ps, /pf,l,t,r,b,m).\n/t\tSet window title.\n/i\tStart as tray icon.\n/o\tKeep window on top.\n/f\tSpecify ini-file (/f0 no ini-file).\n/u\tLaunch with elevated privileges.\n/z\tSkip next (usable for registry-based Notepad replacement)."
IDS_CMDLINEHELP "Command Line Help\n\nfile\tMust be the last argument, no quoted spaces by default.\n+\tAccept multiple file arguments (with quoted spaces).\n-\tAccept single file argument (without quoted spaces).\n…\tEncoding (/ansi, /unicode, /unicodebe, /utf8, /utf8sig).\n…\tLine ending mode (/crlf, /lf, /cr).\n/e\tFile source encoding.\n/g\tJump to specified position (/g -1 end of file).\n/m\tMatch specified text (/m- last, /mr regex, /mb backslash).\n/l\tAuto-reload modified files.\n/q\tForce creation of new files without prompt.\n/s\tSelect specified syntax scheme.\n/d\tSelect default text scheme.\n/h\tSelect Web Source Code scheme.\n/x\tSelect XML Document scheme.\n/c\tOpen new window and paste clipboard contents.\n/b\tOpen new paste board to collect clipboard entries.\n/n\tAlways open a new window (/ns single file instance).\n/r\tReuse window (/rs single file instance).\n/p\tSet window position and size (/p0, /ps, /pf,l,t,r,b,m).\n/t\tSet window title.\n/i\tStart as tray icon.\n/o\tKeep window on top.\n/f\tSpecify ini-file (/f0 no ini-file).\n/u\tLaunch with elevated privileges.\n/v\tPrint file immediately and quit.\n/vd\tPrint file (open printer dialog).\n/z\tSkip next (usable for registry-based Notepad replacement)."
END
STRINGTABLE

View File

@ -41,6 +41,7 @@ extern "C" int iPrintFooter;
extern "C" int iPrintColor;
extern "C" int iPrintZoom;
extern "C" RECT pagesetupMargin;
extern "C" int flagPrintFileAndLeave;
// Stored objects...
@ -137,10 +138,10 @@ extern "C" BOOL EditPrint(HWND hwnd,LPCWSTR pszDocTitle,LPCWSTR pszPageFormat)
} else {
pdlg.Flags |= PD_SELECTION;
}
if (0) {
// Don't display dialog box, just use the default printer and options
pdlg.Flags |= PD_RETURNDEFAULT;
}
// |= 0 - Don't display dialog box, just use the default printer and options
pdlg.Flags |= (flagPrintFileAndLeave == 1) ? PD_RETURNDEFAULT : 0;
if (!PrintDlg(&pdlg)) {
return TRUE; // False means error...
}

View File

@ -2724,10 +2724,8 @@ void Style_Load()
for (iLexer = 0; iLexer < COUNTOF(pLexArray); iLexer++) {
LoadIniSection(pLexArray[iLexer]->pszName,pIniSection,cchIniSection);
if (!IniSectionGetString(pIniSection,L"FileNameExtensions",pLexArray[iLexer]->pszDefExt,
pLexArray[iLexer]->szExtensions,COUNTOF(pLexArray[iLexer]->szExtensions)))
lstrcpyn(pLexArray[iLexer]->szExtensions,pLexArray[iLexer]->pszDefExt,
COUNTOF(pLexArray[iLexer]->szExtensions));
IniSectionGetString(pIniSection, L"FileNameExtensions", pLexArray[iLexer]->pszDefExt,
pLexArray[iLexer]->szExtensions, COUNTOF(pLexArray[iLexer]->szExtensions));
i = 0;
while (pLexArray[iLexer]->Styles[i].iStyle != -1) {
IniSectionGetString(pIniSection,pLexArray[iLexer]->Styles[i].pszName,
@ -2761,7 +2759,7 @@ void Style_Save()
IniSectionSetString(pIniSection,tch,wch);
}
SaveIniSection(L"Custom Colors",pIniSection);
ZeroMemory(pIniSection,cchIniSection);
ZeroMemory(pIniSection, cchIniSection * sizeof(WCHAR));
// auto select
IniSectionSetInt(pIniSection,L"Use2ndDefaultStyle",bUse2ndDefaultStyle);
@ -2777,13 +2775,14 @@ void Style_Save()
IniSectionSetInt(pIniSection,L"SelectDlgSizeY",cyStyleSelectDlg);
SaveIniSection(L"Styles",pIniSection);
ZeroMemory(pIniSection, cchIniSection * sizeof(WCHAR));
if (!fStylesModified) {
LocalFree(pIniSection);
return;
}
ZeroMemory(pIniSection,cchIniSection);
for (iLexer = 0; iLexer < COUNTOF(pLexArray); iLexer++) {
IniSectionSetString(pIniSection,L"FileNameExtensions",pLexArray[iLexer]->szExtensions);
i = 0;
@ -2791,8 +2790,9 @@ void Style_Save()
IniSectionSetString(pIniSection,pLexArray[iLexer]->Styles[i].pszName,pLexArray[iLexer]->Styles[i].szValue);
i++;
}
SaveIniSection(pLexArray[iLexer]->pszName,pIniSection);
ZeroMemory(pIniSection,cchIniSection);
ZeroMemory(pIniSection, cchIniSection * sizeof(WCHAR));
}
LocalFree(pIniSection);
}
@ -2829,10 +2829,8 @@ BOOL Style_Import(HWND hwnd)
for (iLexer = 0; iLexer < COUNTOF(pLexArray); iLexer++) {
if (GetPrivateProfileSection(pLexArray[iLexer]->pszName,pIniSection,cchIniSection,szFile)) {
if (!IniSectionGetString(pIniSection,L"FileNameExtensions",pLexArray[iLexer]->pszDefExt,
pLexArray[iLexer]->szExtensions,COUNTOF(pLexArray[iLexer]->szExtensions)))
lstrcpyn(pLexArray[iLexer]->szExtensions,pLexArray[iLexer]->pszDefExt,
COUNTOF(pLexArray[iLexer]->szExtensions));
IniSectionGetString(pIniSection, L"FileNameExtensions", pLexArray[iLexer]->pszDefExt,
pLexArray[iLexer]->szExtensions, COUNTOF(pLexArray[iLexer]->szExtensions));
i = 0;
while (pLexArray[iLexer]->Styles[i].iStyle != -1) {
IniSectionGetString(pIniSection,pLexArray[iLexer]->Styles[i].pszName,
@ -2888,7 +2886,7 @@ BOOL Style_Export(HWND hwnd)
}
if (!WritePrivateProfileSection(pLexArray[iLexer]->pszName,pIniSection,szFile))
dwError = GetLastError();
ZeroMemory(pIniSection,cchIniSection);
ZeroMemory(pIniSection, cchIniSection * sizeof(WCHAR));
}
LocalFree(pIniSection);
@ -3165,7 +3163,6 @@ void Style_SetLexer(HWND hwnd,PEDITLEXER pLexNew)
SendMessage(hwnd,SCI_SETEXTRADESCENT,0,0);
//wsprintf(lexDefault.Styles[11+iIdx].szValue,L"size:0");
}
{ // set folding style; braces are for scoping only
static const int iMarkerIDs[] =
{
@ -4351,7 +4348,7 @@ int Style_GetLexerIconId(PEDITLEXER plex)
HTREEITEM Style_AddLexerToTreeView(HWND hwnd,PEDITLEXER plex)
{
int i = 0;
WCHAR tch[128];
WCHAR tch[256];
HTREEITEM hTreeNode;
@ -4398,7 +4395,7 @@ HTREEITEM Style_AddLexerToTreeView(HWND hwnd,PEDITLEXER plex)
//
void Style_AddLexerToListView(HWND hwnd,PEDITLEXER plex)
{
WCHAR tch[128];
WCHAR tch[256];
LVITEM lvi;
ZeroMemory(&lvi,sizeof(LVITEM));
@ -4510,14 +4507,15 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
GetDlgItemText(hwnd,IDC_STYLEEDIT,pCurrentStyle->szValue,COUNTOF(pCurrentStyle->szValue));
else if (pCurrentLexer) {
if (!GetDlgItemText(hwnd,IDC_STYLEEDIT,pCurrentLexer->szExtensions,COUNTOF(pCurrentLexer->szExtensions)))
lstrcpy(pCurrentLexer->szExtensions,pCurrentLexer->pszDefExt);
WCHAR szBuf[256] = { L'\0' };
if (GetDlgItemText(hwnd, IDC_STYLEEDIT, szBuf, COUNTOF(szBuf)))
lstrcpy(pCurrentLexer->szExtensions, szBuf);
}
// a lexer has been selected
if (!TreeView_GetParent(hwndTV,lpnmtv->itemNew.hItem))
{
WCHAR wch[128];
WCHAR wch[256];
GetDlgItemText(hwnd,IDC_STYLELABELS,wch,COUNTOF(wch));
if (StrChr(wch,L'|')) *StrChr(wch,L'|') = 0;
@ -4564,7 +4562,7 @@ INT_PTR CALLBACK Style_ConfigDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lP
// a style has been selected
else
{
WCHAR wch[128];
WCHAR wch[256];
GetDlgItemText(hwnd,IDC_STYLELABELS,wch,COUNTOF(wch));
if (StrChr(wch,L'|')) *StrChr(wch,L'|') = 0;

View File

@ -24,7 +24,7 @@ typedef struct _editstyle
int rid;
WCHAR* pszName;
WCHAR* pszDefault;
WCHAR szValue[128];
WCHAR szValue[256];
} EDITSTYLE, *PEDITSTYLE;
@ -42,7 +42,7 @@ typedef struct _editlexer
int rid;
WCHAR* pszName;
WCHAR* pszDefExt;
WCHAR szExtensions[128];
WCHAR szExtensions[256];
PKEYWORDLIST pKeyWords;
EDITSTYLE Styles[];