diff --git a/grepWinNP3/grepWinNP3.vcxproj b/grepWinNP3/grepWinNP3.vcxproj
index edec49f33..77f1a514f 100644
--- a/grepWinNP3/grepWinNP3.vcxproj
+++ b/grepWinNP3/grepWinNP3.vcxproj
@@ -217,6 +217,7 @@
+
@@ -261,7 +262,9 @@
+
+
@@ -275,6 +278,7 @@
+
diff --git a/grepWinNP3/grepWinNP3.vcxproj.filters b/grepWinNP3/grepWinNP3.vcxproj.filters
index 2158e1482..f13ace88f 100644
--- a/grepWinNP3/grepWinNP3.vcxproj.filters
+++ b/grepWinNP3/grepWinNP3.vcxproj.filters
@@ -144,6 +144,9 @@
sktoolslib_mod
+
+ sktoolslib_mod
+
@@ -287,6 +290,15 @@
Header Files
+
+ sktoolslib_mod
+
+
+ Header Files
+
+
+ sktoolslib_mod
+
diff --git a/grepWinNP3/src/COMPtrs.h b/grepWinNP3/src/COMPtrs.h
new file mode 100644
index 000000000..b839f04a3
--- /dev/null
+++ b/grepWinNP3/src/COMPtrs.h
@@ -0,0 +1,38 @@
+// grepWin - regex search and replace for Windows
+
+// Copyright (C) 2007-2009, 2012-2013, 2016, 2019-2020 - Stefan Kueng
+
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software Foundation,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+#pragma once
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+_COM_SMARTPTR_TYPEDEF(IFileOpenDialog, __uuidof(IFileOpenDialog));
+_COM_SMARTPTR_TYPEDEF(IShellItem, __uuidof(IShellItem));
+_COM_SMARTPTR_TYPEDEF(IShellItemArray, __uuidof(IShellItemArray));
+_COM_SMARTPTR_TYPEDEF(IFileOperation, __uuidof(IFileOperation));
+_COM_SMARTPTR_TYPEDEF(IStream, __uuidof(IStream));
+_COM_SMARTPTR_TYPEDEF(IFileSaveDialog, __uuidof(IFileSaveDialog));
+_COM_SMARTPTR_TYPEDEF(IShellItem, __uuidof(IShellItem));
+_COM_SMARTPTR_TYPEDEF(IFileDialogCustomize, __uuidof(IFileDialogCustomize));
diff --git a/grepWinNP3/src/Resources/grepWin.rc b/grepWinNP3/src/Resources/grepWin.rc
index cf1ee315a..bb9e3ced6 100644
--- a/grepWinNP3/src/Resources/grepWin.rc
+++ b/grepWinNP3/src/Resources/grepWin.rc
@@ -90,14 +90,15 @@ BEGIN
CONTROL "Text match",IDC_FILEPATTERNTEXT,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,524,174,61,10
PUSHBUTTON "Settings",IDC_SETTINGSBUTTON,14,197,103,14
PUSHBUTTON "&Replace",IDC_REPLACE,457,198,62,14
- DEFPUSHBUTTON "Search",IDOK,523,198,62,14
+ CONTROL "Search",IDOK,"Button",BS_DEFSPLITBUTTON | WS_TABSTOP,523,198,62,14
GROUPBOX "Limit search",IDC_GROUPLIMITSEARCH,7,128,587,65
CONTROL "",IDC_RESULTLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_OWNERDATA | WS_BORDER | WS_TABSTOP,14,234,571,81
LTEXT "",IDC_SEARCHINFOLABEL,14,321,580,8
- GROUPBOX "Search results",IDC_GROUPSEARCHRESULTS,7,214,587,118
RTEXT "About grepWinNP3",IDC_ABOUTLINK,449,2,136,8
+ GROUPBOX "Search results",IDC_GROUPSEARCHRESULTS,7,214,587,118
CONTROL "Files",IDC_RESULTFILES,"Button",BS_AUTORADIOBUTTON | WS_GROUP,84,222,89,10
- CONTROL "Content",IDC_RESULTCONTENT,"Button",BS_AUTORADIOBUTTON,228,222,104,10
+ CONTROL "Content",IDC_RESULTCONTENT,"Button",BS_AUTORADIOBUTTON,200,222,104,10
+ PUSHBUTTON ">>>",IDC_EXPORT,316,222,28,10,NOT WS_VISIBLE
CONTROL "",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | PBS_SMOOTHREVERSE | PBS_MARQUEE | NOT WS_VISIBLE,130,198,310,14
END
@@ -421,6 +422,13 @@ END
STRINGTABLE
BEGIN
IDS_ERR_PATHNOTEXIST "Path does not exist or is not accessible!"
+ IDS_INVERSESEARCH "Inverse search (NOT searchstring)"
+ IDS_SEARCHINFOUNDFILES "Search in found files"
+ IDS_EXPORT_TT "Export results..."
+ IDS_EXPORTTITLE "Export resultlist"
+ IDS_EXPORTPATHS "include file paths"
+ IDS_EXPORTMATCHLINENUMBER "include match line numbers"
+ IDS_EXPORTMATCHLINECONTENT "include match line text"
END
#endif // Neutral resources
diff --git a/grepWinNP3/src/SearchDlg.cpp b/grepWinNP3/src/SearchDlg.cpp
index 57745236c..096b80130 100644
--- a/grepWinNP3/src/SearchDlg.cpp
+++ b/grepWinNP3/src/SearchDlg.cpp
@@ -46,8 +46,10 @@
#include "DebugOutput.h"
#include "Theme.h"
#include "DarkModeHelper.h"
-
#include "SearchMT.h" // multi-threading helper
+#include "OnOutOfScope.h"
+#include "COMPtrs.h"
+#include "PreserveChdir.h"
#include
#include