mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ upd: grepWinNP3 based on current grepWin ver (boost v1.76 , upd: sktoolslib)
This commit is contained in:
parent
edbea81295
commit
112caf1bcc
@ -220,8 +220,8 @@
|
||||
</nant>
|
||||
<property name="verstring" value="${environment::get-variable('MajorVersion')}.${environment::get-variable('MinorVersion')}.${environment::get-variable('MicroVersion')}" />
|
||||
<property name="verstringfull" value="${verstring}.${environment::get-variable('WCREV')}" />
|
||||
<copy file="bin\Release\grepWin.exe" tofile="bin\grepWin-${verstring}_portable.exe" />
|
||||
<copy file="bin\Release64\grepWin.exe" tofile="bin\grepWin-x64-${verstring}_portable.exe" />
|
||||
<copy file="bin\Release\grepWin.exe" tofile="bin\Release\grepWin-${verstring}_portable.exe" />
|
||||
<copy file="bin\Release64\grepWin.exe" tofile="bin\Release64\grepWin-x64-${verstring}_portable.exe" />
|
||||
<zip zipfile="bin\grepWin-${verstring}_portable.zip" ziplevel="9">
|
||||
<fileset basedir="bin\release">
|
||||
<include name="grepWin-${verstring}_portable.exe" />
|
||||
|
||||
@ -149,6 +149,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>shlwapi.lib;Urlmon.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<CETCompat>true</CETCompat>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
@ -174,6 +175,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>shlwapi.lib;Urlmon.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<CETCompat>true</CETCompat>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
@ -209,6 +211,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>shlwapi.lib;Urlmon.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<CETCompat>true</CETCompat>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
@ -239,6 +242,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>shlwapi.lib;Urlmon.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<CETCompat>true</CETCompat>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
@ -272,6 +276,7 @@
|
||||
<SetChecksum>true</SetChecksum>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>shlwapi.lib;Urlmon.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<CETCompat>true</CETCompat>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
@ -300,6 +305,7 @@
|
||||
<SetChecksum>true</SetChecksum>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<AdditionalDependencies>shlwapi.lib;Urlmon.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<CETCompat>true</CETCompat>
|
||||
</Link>
|
||||
<Manifest>
|
||||
<EnableDpiAwareness>true</EnableDpiAwareness>
|
||||
@ -455,16 +461,16 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Import Project="..\packages\boost.1.75.0.0\build\boost.targets" Condition="Exists('..\packages\boost.1.75.0.0\build\boost.targets')" />
|
||||
<Import Project="..\packages\boost_iostreams-vc142.1.75.0.0\build\boost_iostreams-vc142.targets" Condition="Exists('..\packages\boost_iostreams-vc142.1.75.0.0\build\boost_iostreams-vc142.targets')" />
|
||||
<Import Project="..\packages\boost_regex-vc142.1.75.0.0\build\boost_regex-vc142.targets" Condition="Exists('..\packages\boost_regex-vc142.1.75.0.0\build\boost_regex-vc142.targets')" />
|
||||
<Import Project="..\packages\boost.1.76.0.0\build\boost.targets" Condition="Exists('..\packages\boost.1.76.0.0\build\boost.targets')" />
|
||||
<Import Project="..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets" Condition="Exists('..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets')" />
|
||||
<Import Project="..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets" Condition="Exists('..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\boost.1.75.0.0\build\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost.1.75.0.0\build\boost.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_iostreams-vc142.1.75.0.0\build\boost_iostreams-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_iostreams-vc142.1.75.0.0\build\boost_iostreams-vc142.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_regex-vc142.1.75.0.0\build\boost_regex-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_regex-vc142.1.75.0.0\build\boost_regex-vc142.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost.1.76.0.0\build\boost.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost.1.76.0.0\build\boost.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_iostreams-vc142.1.76.0.0\build\boost_iostreams-vc142.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\boost_regex-vc142.1.76.0.0\build\boost_regex-vc142.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="boost" version="1.75.0.0" targetFramework="native" />
|
||||
<package id="boost_iostreams-vc142" version="1.75.0.0" targetFramework="native" />
|
||||
<package id="boost_regex-vc142" version="1.75.0.0" targetFramework="native" />
|
||||
<package id="boost" version="1.76.0.0" targetFramework="native" />
|
||||
<package id="boost_iostreams-vc142" version="1.76.0.0" targetFramework="native" />
|
||||
<package id="boost_regex-vc142" version="1.76.0.0" targetFramework="native" />
|
||||
</packages>
|
||||
@ -30,9 +30,9 @@
|
||||
# define IsWindows10OrGreater() (IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN10), LOBYTE(_WIN32_WINNT_WIN10), 0))
|
||||
#endif
|
||||
|
||||
typedef HRESULT(__stdcall* DWM_EXTEND_FRAME_INTO_CLIENT_AREA)(HWND, const MARGINS*);
|
||||
typedef HRESULT(__stdcall* DWM_IS_COMPOSITION_ENABLED)(BOOL* pfEnabled);
|
||||
typedef HRESULT(__stdcall* DWM_ENABLE_COMPOSITION)(UINT uCompositionAction);
|
||||
using DWM_EXTEND_FRAME_INTO_CLIENT_AREA = HRESULT(__stdcall* )(HWND, const MARGINS*);
|
||||
using DWM_IS_COMPOSITION_ENABLED = HRESULT(__stdcall* )(BOOL* pfEnabled);
|
||||
using DWM_ENABLE_COMPOSITION = HRESULT(__stdcall* )(UINT uCompositionAction);
|
||||
|
||||
CDwmApiImpl::CDwmApiImpl()
|
||||
: m_hDwmApiLib(nullptr)
|
||||
@ -132,28 +132,28 @@ BOOL CUxThemeAeroImpl::Initialize()
|
||||
return IsInitialized();
|
||||
}
|
||||
|
||||
typedef HRESULT(__stdcall* BUFFERED_PAINT_INIT)();
|
||||
typedef HTHEME(__stdcall* OPEN_THEME_DATA)(HWND hwnd, LPCWSTR pszClassList);
|
||||
typedef HRESULT(__stdcall* CLOSE_THEME_DATA)(HTHEME hTheme);
|
||||
typedef HPAINTBUFFER(__stdcall* BEGIN_BUFFERED_PAINT)(HDC hdcTarget, const RECT* prcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, HDC* phdc);
|
||||
typedef HRESULT(__stdcall* END_BUFFERED_PAINT)(HPAINTBUFFER hBufferedPaint, BOOL fUpdateTarget);
|
||||
typedef HRESULT(__stdcall* DRAW_THEME_TEXT_EX)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS* pOptions);
|
||||
typedef HRESULT(__stdcall* GET_THEME_INT)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int* piVal);
|
||||
typedef HRESULT(__stdcall* GET_THEME_SYS_FONT)(HTHEME hTheme, int iFontId, LOGFONTW* plf);
|
||||
typedef HRESULT(__stdcall* BUFFERED_PAINT_SET_ALPHA)(HPAINTBUFFER hBufferedPaint, const RECT* prc, BYTE alpha);
|
||||
typedef HRESULT(__stdcall* DRAW_THEME_BACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pRect, const RECT* pClipRect);
|
||||
typedef HRESULT(__stdcall* GET_THEME_BKG_CONTENT_RECT)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pBoundingRect, LPRECT pContentRect);
|
||||
typedef HRESULT(__stdcall* GET_THEME_BKG_CONTENT_EXTENT)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pContentRect, LPRECT pExtentRect);
|
||||
typedef HRESULT(__stdcall* GET_THEME_BITMAP)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, ULONG dwFlags, HBITMAP* phBitmap);
|
||||
typedef HRESULT(__stdcall* DRAW_THEME_PARENT_BACKGROUND)(HWND hwnd, HDC hdc, const RECT* prc);
|
||||
typedef BOOL(__stdcall* IS_THEME_BACKGROUND_PARTIALLY_TRANSPARENT)(HTHEME hTheme, int iPartId, int iStateId);
|
||||
typedef HRESULT(__stdcall* DRAW_THEME_TEXT)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect);
|
||||
typedef HRESULT(__stdcall* GET_THEME_COLOR)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF* pColor);
|
||||
typedef HRESULT(__stdcall* GET_THEME_PART_SIZE)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT prc, THEMESIZE eSize, SIZE* psz);
|
||||
typedef HRESULT(__stdcall* GET_THEME_POSITION)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, POINT* pPoint);
|
||||
typedef HRESULT(__stdcall* GET_THEME_MARGINS)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LPRECT prc, MARGINS* pMargins);
|
||||
typedef HRESULT(__stdcall* GET_THEME_METRIC)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int* piVal);
|
||||
typedef HRESULT(__stdcall* GET_THEME_RECT)(HTHEME hTheme, int iPartId, int iStateId, int iPropId, LPRECT pRect);
|
||||
using BUFFERED_PAINT_INIT = HRESULT(__stdcall* )();
|
||||
using OPEN_THEME_DATA = HTHEME(__stdcall* )(HWND hwnd, LPCWSTR pszClassList);
|
||||
using CLOSE_THEME_DATA = HRESULT(__stdcall* )(HTHEME hTheme);
|
||||
using BEGIN_BUFFERED_PAINT = HPAINTBUFFER(__stdcall* )(HDC hdcTarget, const RECT* prcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS* pPaintParams, HDC* phdc);
|
||||
using END_BUFFERED_PAINT = HRESULT(__stdcall* )(HPAINTBUFFER hBufferedPaint, BOOL fUpdateTarget);
|
||||
using DRAW_THEME_TEXT_EX = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS* pOptions);
|
||||
using GET_THEME_INT = HRESULT(__stdcall* )(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int* piVal);
|
||||
using GET_THEME_SYS_FONT = HRESULT(__stdcall* )(HTHEME hTheme, int iFontId, LOGFONTW* plf);
|
||||
using BUFFERED_PAINT_SET_ALPHA = HRESULT(__stdcall* )(HPAINTBUFFER hBufferedPaint, const RECT* prc, BYTE alpha);
|
||||
using DRAW_THEME_BACKGROUND = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pRect, const RECT* pClipRect);
|
||||
using GET_THEME_BKG_CONTENT_RECT = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pBoundingRect, LPRECT pContentRect);
|
||||
using GET_THEME_BKG_CONTENT_EXTENT = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pContentRect, LPRECT pExtentRect);
|
||||
using GET_THEME_BITMAP = HRESULT(__stdcall* )(HTHEME hTheme, int iPartId, int iStateId, int iPropId, ULONG dwFlags, HBITMAP* phBitmap);
|
||||
using DRAW_THEME_PARENT_BACKGROUND = HRESULT(__stdcall* )(HWND hwnd, HDC hdc, const RECT* prc);
|
||||
using IS_THEME_BACKGROUND_PARTIALLY_TRANSPARENT = BOOL(__stdcall* )(HTHEME hTheme, int iPartId, int iStateId);
|
||||
using DRAW_THEME_TEXT = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect);
|
||||
using GET_THEME_COLOR = HRESULT(__stdcall* )(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF* pColor);
|
||||
using GET_THEME_PART_SIZE = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT prc, THEMESIZE eSize, SIZE* psz);
|
||||
using GET_THEME_POSITION = HRESULT(__stdcall* )(HTHEME hTheme, int iPartId, int iStateId, int iPropId, POINT* pPoint);
|
||||
using GET_THEME_MARGINS = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LPRECT prc, MARGINS* pMargins);
|
||||
using GET_THEME_METRIC = HRESULT(__stdcall* )(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int* piVal);
|
||||
using GET_THEME_RECT = HRESULT(__stdcall* )(HTHEME hTheme, int iPartId, int iStateId, int iPropId, LPRECT pRect);
|
||||
|
||||
BOOL CUxThemeAeroImpl::IsInitialized() const
|
||||
{
|
||||
|
||||
@ -59,7 +59,7 @@ class CAutoComplete : public CRegHistory
|
||||
{
|
||||
public:
|
||||
CAutoComplete(CSimpleIni* pIni = nullptr);
|
||||
~CAutoComplete();
|
||||
~CAutoComplete() override;
|
||||
|
||||
bool Init(HWND hEdit);
|
||||
bool Enable(bool bEnable) const;
|
||||
|
||||
@ -94,7 +94,7 @@ CBrowseFolder::RetVal CBrowseFolder::Show(HWND parent, std::wstring& path, const
|
||||
// set the default folder
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
typedef HRESULT(WINAPI * SHCIFPN)(PCWSTR pszPath, IBindCtx * pbc, REFIID riid, void** ppv);
|
||||
using SHCIFPN = HRESULT(WINAPI * )(PCWSTR pszPath, IBindCtx * pbc, REFIID riid, void** ppv);
|
||||
|
||||
HMODULE hLib = LoadLibrary(L"shell32.dll");
|
||||
if (hLib)
|
||||
|
||||
@ -52,8 +52,8 @@
|
||||
class CCmdLineParser
|
||||
{
|
||||
public:
|
||||
typedef std::map<std::wstring, std::wstring> CValsMap;
|
||||
typedef CValsMap::const_iterator ITERPOS;
|
||||
using CValsMap = std::map<std::wstring, std::wstring>;
|
||||
using ITERPOS = CValsMap::const_iterator;
|
||||
|
||||
/**
|
||||
* Creates a CCmdLineParser object and parses the parameters in.
|
||||
|
||||
@ -160,10 +160,10 @@ private:
|
||||
}
|
||||
|
||||
private:
|
||||
typedef UINT STDAPICALLTYPE GetDpiForWindowFn(HWND hWnd);
|
||||
typedef UINT STDAPICALLTYPE GetDpiForSystemFn();
|
||||
typedef UINT STDAPICALLTYPE GetSystemMetricsForDpiFn(int nIndex, UINT dpi);
|
||||
typedef UINT STDAPICALLTYPE SystemParametersInfoForDpiFn(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni, UINT dpi);
|
||||
using GetDpiForWindowFn = UINT STDAPICALLTYPE(HWND hWnd);
|
||||
using GetDpiForSystemFn = UINT STDAPICALLTYPE();
|
||||
using GetSystemMetricsForDpiFn = UINT STDAPICALLTYPE(int nIndex, UINT dpi);
|
||||
using SystemParametersInfoForDpiFn = UINT STDAPICALLTYPE(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni, UINT dpi);
|
||||
|
||||
GetDpiForWindowFn * pfnGetDpiForWindow;
|
||||
GetDpiForSystemFn * pfnGetDpiForSystem;
|
||||
|
||||
@ -97,18 +97,18 @@ private:
|
||||
DarkModeHelper();
|
||||
~DarkModeHelper();
|
||||
|
||||
typedef void(WINAPI* AllowDarkModeForAppFpn)(BOOL allow);
|
||||
typedef PreferredAppMode(WINAPI* SetPreferredAppModeFpn)(PreferredAppMode appMode);
|
||||
typedef void(WINAPI* AllowDarkModeForWindowFpn)(HWND hwnd, BOOL allow);
|
||||
typedef BOOL(WINAPI* ShouldAppsUseDarkModeFpn)();
|
||||
typedef BOOL(WINAPI* IsDarkModeAllowedForWindowFpn)(HWND hwnd);
|
||||
typedef BOOL(WINAPI* IsDarkModeAllowedForAppFpn)();
|
||||
typedef BOOL(WINAPI* ShouldSystemUseDarkModeFpn)();
|
||||
typedef void(WINAPI* RefreshImmersiveColorPolicyStateFn)();
|
||||
typedef BOOL(WINAPI* GetIsImmersiveColorUsingHighContrastFn)(IMMERSIVE_HC_CACHE_MODE mode);
|
||||
typedef void(WINAPI* FlushMenuThemesFn)();
|
||||
typedef HTHEME(WINAPI* OpenNcThemeDataFpn)(HWND hWnd, LPCWSTR pszClassList);
|
||||
typedef BOOL(WINAPI* SetWindowCompositionAttributeFpn)(HWND hwnd, WINDOWCOMPOSITIONATTRIBDATA* data);
|
||||
using AllowDarkModeForAppFpn = void(WINAPI* )(BOOL allow);
|
||||
using SetPreferredAppModeFpn = PreferredAppMode(WINAPI* )(PreferredAppMode appMode);
|
||||
using AllowDarkModeForWindowFpn = void(WINAPI* )(HWND hwnd, BOOL allow);
|
||||
using ShouldAppsUseDarkModeFpn = BOOL(WINAPI* )();
|
||||
using IsDarkModeAllowedForWindowFpn = BOOL(WINAPI* )(HWND hwnd);
|
||||
using IsDarkModeAllowedForAppFpn = BOOL(WINAPI* )();
|
||||
using ShouldSystemUseDarkModeFpn = BOOL(WINAPI* )();
|
||||
using RefreshImmersiveColorPolicyStateFn = void(WINAPI* )();
|
||||
using GetIsImmersiveColorUsingHighContrastFn = BOOL(WINAPI* )(IMMERSIVE_HC_CACHE_MODE mode);
|
||||
using FlushMenuThemesFn = void(WINAPI* )();
|
||||
using OpenNcThemeDataFpn = HTHEME(WINAPI* )(HWND hWnd, LPCWSTR pszClassList);
|
||||
using SetWindowCompositionAttributeFpn = BOOL(WINAPI* )(HWND hwnd, WINDOWCOMPOSITIONATTRIBDATA* data);
|
||||
|
||||
AllowDarkModeForAppFpn m_pAllowDarkModeForApp = nullptr;
|
||||
SetPreferredAppModeFpn m_pSetPreferredAppMode = nullptr;
|
||||
|
||||
@ -118,28 +118,28 @@ void CDlgResizer::DoResize(int width, int height)
|
||||
return;
|
||||
|
||||
InvalidateRect(m_hDlg, nullptr, true);
|
||||
HDWP hdwp = BeginDeferWindowPos(static_cast<int>(m_controls.size()));
|
||||
HDWP hDwp = BeginDeferWindowPos(static_cast<int>(m_controls.size()));
|
||||
|
||||
wchar_t className[257]; // WNDCLASS docs say 256 is the longest class name possible.
|
||||
std::vector<std::pair<size_t, DWORD>> savedSelections;
|
||||
for (size_t i = 0; i < m_controls.size(); ++i)
|
||||
{
|
||||
const auto& ctrlInfo = m_controls[i];
|
||||
wchar_t className[257];
|
||||
const auto& [hWnd, resizeType, origSize] = m_controls[i];
|
||||
// Work around a bug in the standard combo box control that causes it to
|
||||
// incorrectly change the selection status after resizing. Without this
|
||||
// fix sometimes the combo box will show selected text after a WM_SIZE
|
||||
// resize type event even if there was no text selected before the size event.
|
||||
// The workaround is to save the current selection state before the resize and
|
||||
// to restore that state after the resize.
|
||||
int status = GetClassName(ctrlInfo.hWnd, className, static_cast<int>(std::size(className)));
|
||||
int status = GetClassName(hWnd, className, static_cast<int>(std::size(className)));
|
||||
bool isComboBox = status > 0 && _wcsicmp(className, WC_COMBOBOX) == 0;
|
||||
if (isComboBox)
|
||||
{
|
||||
DWORD sel = ComboBox_GetEditSel(ctrlInfo.hWnd);
|
||||
DWORD sel = ComboBox_GetEditSel(hWnd);
|
||||
savedSelections.push_back({i, sel});
|
||||
}
|
||||
RECT newPos = ctrlInfo.origSize;
|
||||
switch (ctrlInfo.resizeType)
|
||||
RECT newPos = origSize;
|
||||
switch (resizeType)
|
||||
{
|
||||
case RESIZER_TOPLEFT:
|
||||
break; // do nothing - the original position is fine
|
||||
@ -178,11 +178,11 @@ void CDlgResizer::DoResize(int width, int height)
|
||||
newPos.bottom += (height - m_dlgRect.bottom);
|
||||
break;
|
||||
}
|
||||
hdwp = DeferWindowPos(hdwp, ctrlInfo.hWnd, nullptr, newPos.left, newPos.top,
|
||||
hDwp = DeferWindowPos(hDwp, hWnd, nullptr, newPos.left, newPos.top,
|
||||
newPos.right - newPos.left, newPos.bottom - newPos.top,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
EndDeferWindowPos(hdwp);
|
||||
EndDeferWindowPos(hDwp);
|
||||
for (const auto& [index, sel] : savedSelections)
|
||||
{
|
||||
int startSel = LOWORD(sel);
|
||||
|
||||
@ -132,7 +132,6 @@ STDMETHODIMP FileDataObject::GetData(FORMATETC* pformatetcIn, STGMEDIUM* pmedium
|
||||
pszBuff++;
|
||||
}
|
||||
*pszBuff = 0;
|
||||
pszBuff = reinterpret_cast<wchar_t*>(reinterpret_cast<LPBYTE>(pDrop) + sizeof(DROPFILES));
|
||||
GlobalUnlock(hgDrop);
|
||||
pmedium->hGlobal = hgDrop;
|
||||
pmedium->tymed = TYMED_HGLOBAL;
|
||||
@ -262,12 +261,24 @@ STDMETHODIMP FileDataObject::SetData(FORMATETC* pformatetc, STGMEDIUM* pmedium,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP FileDataObject::EnumFormatEtc(DWORD /*dwDirection*/, IEnumFORMATETC** ppenumFormatEtc)
|
||||
STDMETHODIMP FileDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC** ppenumFormatEtc)
|
||||
{
|
||||
if (ppenumFormatEtc == nullptr)
|
||||
return E_POINTER;
|
||||
|
||||
return E_NOTIMPL;
|
||||
*ppenumFormatEtc = nullptr;
|
||||
switch (dwDirection)
|
||||
{
|
||||
case DATADIR_GET:
|
||||
*ppenumFormatEtc = new CEnumFormatEtcHelper(m_vecFormatEtc);
|
||||
if (*ppenumFormatEtc == nullptr)
|
||||
return E_OUTOFMEMORY;
|
||||
(*ppenumFormatEtc)->AddRef();
|
||||
break;
|
||||
default:
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP FileDataObject::DAdvise(FORMATETC* /*pformatetc*/, DWORD /*advf*/, IAdviseSink* /*pAdvSink*/, DWORD* /*pdwConnection*/)
|
||||
@ -391,6 +402,136 @@ HRESULT STDMETHODCALLTYPE FileDataObject::SetDropDescription(DROPIMAGETYPE image
|
||||
return SetData(&fetc, &medium, TRUE);
|
||||
}
|
||||
|
||||
void CEnumFormatEtcHelper::Init()
|
||||
{
|
||||
m_formats[1].cfFormat = CF_PREFERREDDROPEFFECT;
|
||||
m_formats[1].dwAspect = DVASPECT_CONTENT;
|
||||
m_formats[1].lindex = -1;
|
||||
m_formats[1].ptd = nullptr;
|
||||
m_formats[1].tymed = TYMED_HGLOBAL;
|
||||
|
||||
m_formats[0].cfFormat = CF_HDROP;
|
||||
m_formats[0].dwAspect = DVASPECT_CONTENT;
|
||||
m_formats[0].lindex = -1;
|
||||
m_formats[0].ptd = nullptr;
|
||||
m_formats[0].tymed = TYMED_HGLOBAL;
|
||||
}
|
||||
|
||||
CEnumFormatEtcHelper::CEnumFormatEtcHelper(const std::vector<FORMATETC>& vec)
|
||||
: m_cRefCount(0)
|
||||
, m_iCur(0)
|
||||
{
|
||||
for (size_t i = 0; i < vec.size(); ++i)
|
||||
m_vecFormatEtc.push_back(vec[i]);
|
||||
Init();
|
||||
}
|
||||
|
||||
CEnumFormatEtcHelper::CEnumFormatEtcHelper(const std::vector<FORMATETC*>& vec)
|
||||
: m_cRefCount(0)
|
||||
, m_iCur(0)
|
||||
{
|
||||
for (size_t i = 0; i < vec.size(); ++i)
|
||||
m_vecFormatEtc.push_back(*vec[i]);
|
||||
Init();
|
||||
}
|
||||
|
||||
STDMETHODIMP CEnumFormatEtcHelper::QueryInterface(REFIID refiid, void** ppv)
|
||||
{
|
||||
*ppv = nullptr;
|
||||
if (IID_IUnknown == refiid || IID_IEnumFORMATETC == refiid)
|
||||
*ppv = this;
|
||||
|
||||
if (*ppv != nullptr)
|
||||
{
|
||||
static_cast<LPUNKNOWN>(*ppv)->AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE CEnumFormatEtcHelper::AddRef()
|
||||
{
|
||||
return ++m_cRefCount;
|
||||
}
|
||||
|
||||
ULONG STDMETHODCALLTYPE CEnumFormatEtcHelper::Release()
|
||||
{
|
||||
--m_cRefCount;
|
||||
if (m_cRefCount == 0)
|
||||
{
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return m_cRefCount;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEnumFormatEtcHelper::Next(ULONG celt, LPFORMATETC lpFormatEtc, ULONG* pceltFetched)
|
||||
{
|
||||
if (celt <= 0)
|
||||
return E_INVALIDARG;
|
||||
if (pceltFetched == nullptr && celt != 1) // pceltFetched can be NULL only for 1 item request
|
||||
return E_POINTER;
|
||||
if (lpFormatEtc == nullptr)
|
||||
return E_POINTER;
|
||||
|
||||
if (pceltFetched != nullptr)
|
||||
*pceltFetched = 0;
|
||||
|
||||
if (m_iCur >= DRAG_NUMFORMATS)
|
||||
return S_FALSE;
|
||||
|
||||
ULONG cReturn = celt;
|
||||
|
||||
while (m_iCur < (DRAG_NUMFORMATS + m_vecFormatEtc.size()) && cReturn > 0)
|
||||
{
|
||||
if (m_iCur < DRAG_NUMFORMATS)
|
||||
*lpFormatEtc++ = m_formats[m_iCur++];
|
||||
else
|
||||
*lpFormatEtc++ = m_vecFormatEtc[m_iCur++ - DRAG_NUMFORMATS];
|
||||
--cReturn;
|
||||
}
|
||||
|
||||
if (pceltFetched != nullptr)
|
||||
*pceltFetched = celt - cReturn;
|
||||
|
||||
return (cReturn == 0) ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEnumFormatEtcHelper::Skip(ULONG celt)
|
||||
{
|
||||
if ((m_iCur + static_cast<int>(celt)) >= (DRAG_NUMFORMATS + m_vecFormatEtc.size()))
|
||||
return S_FALSE;
|
||||
m_iCur += celt;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEnumFormatEtcHelper::Reset()
|
||||
{
|
||||
m_iCur = 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CEnumFormatEtcHelper::Clone(IEnumFORMATETC** ppCloneEnumFormatEtc)
|
||||
{
|
||||
if (ppCloneEnumFormatEtc == nullptr)
|
||||
return E_POINTER;
|
||||
|
||||
try
|
||||
{
|
||||
CEnumFormatEtcHelper* newEnum = new CEnumFormatEtcHelper(m_vecFormatEtc);
|
||||
|
||||
newEnum->AddRef();
|
||||
newEnum->m_iCur = m_iCur;
|
||||
*ppCloneEnumFormatEtc = newEnum;
|
||||
}
|
||||
catch (const std::bad_alloc&)
|
||||
{
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDropFiles::CDropFiles()
|
||||
{
|
||||
}
|
||||
|
||||
@ -162,18 +162,15 @@ public:
|
||||
}
|
||||
}
|
||||
//IUnknown
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(
|
||||
/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR* __RPC_FAR* ppvObject) override;
|
||||
ULONG STDMETHODCALLTYPE AddRef() override;
|
||||
ULONG STDMETHODCALLTYPE Release() override;
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(/* [in] */ REFIID riid,
|
||||
/* [iid_is][out] */ void __RPC_FAR* __RPC_FAR* ppvObject) override;
|
||||
ULONG STDMETHODCALLTYPE AddRef() override;
|
||||
ULONG STDMETHODCALLTYPE Release() override;
|
||||
//IDropSource
|
||||
HRESULT STDMETHODCALLTYPE QueryContinueDrag(
|
||||
/* [in] */ BOOL fEscapePressed,
|
||||
/* [in] */ DWORD grfKeyState) override;
|
||||
HRESULT STDMETHODCALLTYPE QueryContinueDrag(/* [in] */ BOOL fEscapePressed,
|
||||
/* [in] */ DWORD grfKeyState) override;
|
||||
|
||||
HRESULT STDMETHODCALLTYPE GiveFeedback(
|
||||
/* [in] */ DWORD dwEffect) override;
|
||||
HRESULT STDMETHODCALLTYPE GiveFeedback(/* [in] */ DWORD dwEffect) override;
|
||||
};
|
||||
|
||||
extern CLIPFORMAT CF_FILECONTENTS;
|
||||
@ -232,6 +229,36 @@ private:
|
||||
std::vector<STGMEDIUM*> m_vecStgMedium;
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper class for the FileDataObject class: implements the enumerator
|
||||
* for the supported clipboard formats of the FileDataObject class.
|
||||
*/
|
||||
class CEnumFormatEtcHelper : public IEnumFORMATETC
|
||||
{
|
||||
public:
|
||||
CEnumFormatEtcHelper(const std::vector<FORMATETC*>& vec);
|
||||
CEnumFormatEtcHelper(const std::vector<FORMATETC>& vec);
|
||||
virtual ~CEnumFormatEtcHelper() = default;
|
||||
//IUnknown members
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, void**) override;
|
||||
ULONG STDMETHODCALLTYPE AddRef() override;
|
||||
ULONG STDMETHODCALLTYPE Release() override;
|
||||
|
||||
//IEnumFORMATETC members
|
||||
HRESULT STDMETHODCALLTYPE Next(ULONG, LPFORMATETC, ULONG*) override;
|
||||
HRESULT STDMETHODCALLTYPE Skip(ULONG) override;
|
||||
HRESULT STDMETHODCALLTYPE Reset() override;
|
||||
HRESULT STDMETHODCALLTYPE Clone(IEnumFORMATETC**) override;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
std::vector<FORMATETC> m_vecFormatEtc;
|
||||
FORMATETC m_formats[DRAG_NUMFORMATS];
|
||||
ULONG m_cRefCount;
|
||||
size_t m_iCur;
|
||||
};
|
||||
|
||||
class CDragSourceHelper
|
||||
{
|
||||
IDragSourceHelper2* pDragSourceHelper2;
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
#include <vector>
|
||||
#include <Wincrypt.h>
|
||||
|
||||
std::wstring GetHashText(const void* data, const size_t dataSize, HashType hashType)
|
||||
std::wstring GetHashText(const void* data, size_t dataSize, HashType hashType)
|
||||
{
|
||||
HCRYPTPROV hProv = NULL;
|
||||
|
||||
|
||||
@ -28,4 +28,4 @@ enum class HashType
|
||||
HashSha256
|
||||
};
|
||||
|
||||
std::wstring GetHashText(const void* data, const size_t dataSize, HashType hashType);
|
||||
std::wstring GetHashText(const void* data, size_t dataSize, HashType hashType);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// sktoolslib - common files for SK tools
|
||||
|
||||
// Copyright (C) 2020 - Stefan Kueng
|
||||
// Copyright (C) 2020-2021 - Stefan Kueng
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
@ -23,49 +23,54 @@
|
||||
|
||||
CInfoRtfDialog::CInfoRtfDialog()
|
||||
: m_hParent(nullptr)
|
||||
, m_hwndRichEdit(nullptr)
|
||||
, m_rtfId(0)
|
||||
, m_iconId(0)
|
||||
, m_hwndRichEdit(nullptr)
|
||||
{
|
||||
m_richEditLib = LoadLibrary(TEXT("Msftedit.dll"));
|
||||
}
|
||||
|
||||
CInfoRtfDialog::~CInfoRtfDialog(void)
|
||||
CInfoRtfDialog::~CInfoRtfDialog()
|
||||
{
|
||||
}
|
||||
|
||||
INT_PTR CInfoRtfDialog::DoModal(HINSTANCE hInstance, HWND hParent, const std::string& dlgTitle, UINT rtfId, const std::wstring& resType, UINT iconId, int width, int height)
|
||||
{
|
||||
return DoModal(hInstance, hParent, dlgTitle, rtfId, resType, iconId, 10, 10, width, height);
|
||||
}
|
||||
|
||||
INT_PTR CInfoRtfDialog::DoModal(HINSTANCE hInstance, HWND hParent, const std::string& dlgTitle, UINT rtfId, const std::wstring& resType, UINT iconId, int x, int y, int width, int height)
|
||||
{
|
||||
m_hParent = hParent;
|
||||
m_rtfId = rtfId;
|
||||
m_rtfResType = resType;
|
||||
m_iconId = iconId;
|
||||
|
||||
auto hgbl = GlobalAlloc(GMEM_ZEROINIT, 1024);
|
||||
OnOutOfScope(GlobalFree(hgbl));
|
||||
if (!hgbl)
|
||||
auto hGbl = GlobalAlloc(GMEM_ZEROINIT, 1024);
|
||||
OnOutOfScope(GlobalFree(hGbl));
|
||||
if (!hGbl)
|
||||
return -1;
|
||||
|
||||
auto lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl);
|
||||
auto lpDt = static_cast<LPDLGTEMPLATE>(GlobalLock(hGbl));
|
||||
|
||||
// Define a dialog box.
|
||||
|
||||
lpdt->style = WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION | WS_SIZEBOX;
|
||||
lpdt->cdit = 0; // Number of controls
|
||||
lpdt->x = 10;
|
||||
lpdt->y = 10;
|
||||
lpdt->cx = (short)width;
|
||||
lpdt->cy = (short)height;
|
||||
lpDt->style = WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION | WS_SIZEBOX;
|
||||
lpDt->cdit = 0; // Number of controls
|
||||
lpDt->x = static_cast<SHORT>(x);
|
||||
lpDt->y = static_cast<SHORT>(y);
|
||||
lpDt->cx = static_cast<short>(width);
|
||||
lpDt->cy = static_cast<short>(height);
|
||||
|
||||
auto lpw = (LPWORD)(lpdt + 1);
|
||||
auto lpw = reinterpret_cast<LPWORD>(lpDt + 1);
|
||||
*lpw++ = 0; // No menu
|
||||
*lpw++ = 0; // Predefined dialog box class (by default)
|
||||
|
||||
auto lpwsz = (LPWSTR)lpw;
|
||||
auto nchar = 1 + MultiByteToWideChar(CP_UTF8, 0, dlgTitle.c_str(), -1, lpwsz, 50);
|
||||
auto lpWsz = reinterpret_cast<LPWSTR>(lpw);
|
||||
auto nchar = 1 + MultiByteToWideChar(CP_UTF8, 0, dlgTitle.c_str(), -1, lpWsz, 50);
|
||||
lpw += nchar;
|
||||
GlobalUnlock(hgbl);
|
||||
return __super::DoModal(hInstance, lpdt, hParent);
|
||||
GlobalUnlock(hGbl);
|
||||
return __super::DoModal(hInstance, lpDt, hParent);
|
||||
}
|
||||
|
||||
void CInfoRtfDialog::ShowModeless(HINSTANCE hInstance, HWND hParent, const std::string& dlgTitle, UINT rtfId, const std::wstring& resType, UINT iconId, int width, int height)
|
||||
@ -75,31 +80,31 @@ void CInfoRtfDialog::ShowModeless(HINSTANCE hInstance, HWND hParent, const std::
|
||||
m_rtfResType = resType;
|
||||
m_iconId = iconId;
|
||||
|
||||
auto hgbl = GlobalAlloc(GMEM_ZEROINIT, 1024);
|
||||
OnOutOfScope(GlobalFree(hgbl));
|
||||
if (!hgbl)
|
||||
auto hGbl = GlobalAlloc(GMEM_ZEROINIT, 1024);
|
||||
OnOutOfScope(GlobalFree(hGbl));
|
||||
if (!hGbl)
|
||||
return;
|
||||
|
||||
auto lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl);
|
||||
auto lpDt = static_cast<LPDLGTEMPLATE>(GlobalLock(hGbl));
|
||||
|
||||
// Define a dialog box.
|
||||
|
||||
lpdt->style = WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION | WS_SIZEBOX;
|
||||
lpdt->cdit = 0; // Number of controls
|
||||
lpdt->x = 10;
|
||||
lpdt->y = 10;
|
||||
lpdt->cx = (short)width;
|
||||
lpdt->cy = (short)height;
|
||||
lpDt->style = WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION | WS_SIZEBOX;
|
||||
lpDt->cdit = 0; // Number of controls
|
||||
lpDt->x = 10;
|
||||
lpDt->y = 10;
|
||||
lpDt->cx = static_cast<short>(width);
|
||||
lpDt->cy = static_cast<short>(height);
|
||||
|
||||
auto lpw = (LPWORD)(lpdt + 1);
|
||||
auto lpw = reinterpret_cast<LPWORD>(lpDt + 1);
|
||||
*lpw++ = 0; // No menu
|
||||
*lpw++ = 0; // Predefined dialog box class (by default)
|
||||
|
||||
auto lpwsz = (LPWSTR)lpw;
|
||||
auto nchar = 1 + MultiByteToWideChar(CP_UTF8, 0, dlgTitle.c_str(), -1, lpwsz, 50);
|
||||
auto lpWsz = reinterpret_cast<LPWSTR>(lpw);
|
||||
auto nchar = 1 + MultiByteToWideChar(CP_UTF8, 0, dlgTitle.c_str(), -1, lpWsz, 50);
|
||||
lpw += nchar;
|
||||
GlobalUnlock(hgbl);
|
||||
__super::ShowModeless(hInstance, lpdt, hParent);
|
||||
GlobalUnlock(hGbl);
|
||||
__super::ShowModeless(hInstance, lpDt, hParent);
|
||||
}
|
||||
|
||||
LRESULT CInfoRtfDialog::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
@ -122,22 +127,22 @@ LRESULT CInfoRtfDialog::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||
auto hResourceLoaded = LoadResource(hResource, hRes);
|
||||
if (hResourceLoaded)
|
||||
{
|
||||
auto lpResLock = (const char*)LockResource(hResourceLoaded);
|
||||
auto reslen = SizeofResource(hResource, hRes);
|
||||
if (reslen)
|
||||
auto lpResLock = static_cast<const char*>(LockResource(hResourceLoaded));
|
||||
auto resLen = SizeofResource(hResource, hRes);
|
||||
if (resLen)
|
||||
{
|
||||
SETTEXTEX stt = {0};
|
||||
stt.codepage = CP_UTF8;
|
||||
stt.flags = ST_DEFAULT | ST_NEWCHARS;
|
||||
SendMessage(m_hwndRichEdit, EM_SETTEXTEX, (WPARAM)&stt, (LPARAM)lpResLock);
|
||||
SendMessage(m_hwndRichEdit, EM_SETTEXTEX, reinterpret_cast<WPARAM>(&stt), reinterpret_cast<LPARAM>(lpResLock));
|
||||
SetFocus(m_hwndRichEdit);
|
||||
SendMessage(m_hwndRichEdit, EM_SETSEL, (WPARAM)-1, (LPARAM)0);
|
||||
SendMessage(m_hwndRichEdit, EM_SETREADONLY, (WPARAM)1, (LPARAM) nullptr);
|
||||
SendMessage(m_hwndRichEdit, EM_SETSEL, static_cast<WPARAM>(-1), static_cast<LPARAM>(0));
|
||||
SendMessage(m_hwndRichEdit, EM_SETREADONLY, static_cast<WPARAM>(1), reinterpret_cast<LPARAM>(nullptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (INT_PTR)TRUE;
|
||||
return static_cast<INT_PTR>(TRUE);
|
||||
}
|
||||
case WM_SIZE:
|
||||
{
|
||||
@ -154,9 +159,9 @@ LRESULT CInfoRtfDialog::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
|
||||
CloseWindow(m_hwndRichEdit);
|
||||
DestroyWindow(m_hwndRichEdit);
|
||||
EndDialog(*this, LOWORD(wParam));
|
||||
return (INT_PTR)TRUE;
|
||||
return static_cast<INT_PTR>(TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return (INT_PTR)FALSE;
|
||||
return static_cast<INT_PTR>(FALSE);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// sktoolslib - common files for SK tools
|
||||
|
||||
// Copyright (C) 2020 - Stefan Kueng
|
||||
// Copyright (C) 2020-2021 - Stefan Kueng
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
@ -29,13 +29,14 @@ class CInfoRtfDialog : public CDialog
|
||||
{
|
||||
public:
|
||||
CInfoRtfDialog();
|
||||
~CInfoRtfDialog(void);
|
||||
~CInfoRtfDialog();
|
||||
|
||||
INT_PTR DoModal(HINSTANCE hInstance, HWND hParent, const std::string& dlgTitle, UINT rtfId, const std::wstring& resType, UINT iconId, int width, int height);
|
||||
INT_PTR DoModal(HINSTANCE hInstance, HWND hParent, const std::string& dlgTitle, UINT rtfId, const std::wstring& resType, UINT iconId, int x, int y, int width, int height);
|
||||
void ShowModeless(HINSTANCE hInstance, HWND hParent, const std::string& dlgTitle, UINT rtfId, const std::wstring& resType, UINT iconId, int width, int height);
|
||||
|
||||
protected:
|
||||
LRESULT CALLBACK DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
||||
|
||||
private:
|
||||
HWND m_hParent;
|
||||
|
||||
@ -30,7 +30,7 @@ using Microsoft::WRL::ComPtr;
|
||||
HRESULT SetAppID(LPCWSTR appID)
|
||||
{
|
||||
// set the AppID
|
||||
typedef HRESULT STDAPICALLTYPE SetCurrentProcessExplicitAppUserModelIdfn(PCWSTR appId);
|
||||
using SetCurrentProcessExplicitAppUserModelIdfn = HRESULT STDAPICALLTYPE(PCWSTR appId);
|
||||
CAutoLibrary hShell = LoadLibraryExW(L"Shell32.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||
if (hShell)
|
||||
{
|
||||
|
||||
@ -53,6 +53,9 @@ bool CLanguage::LoadFile(const std::wstring& path)
|
||||
|
||||
lastLangPath = path;
|
||||
|
||||
// since stream classes still expect the filepath in char and not wchar_t
|
||||
// we need to convert the filepath to multibyte first
|
||||
|
||||
std::ifstream file;
|
||||
try
|
||||
{
|
||||
|
||||
@ -94,7 +94,7 @@ public:
|
||||
|
||||
/// used in subclass templates to specify the correct string type
|
||||
|
||||
typedef S StringT;
|
||||
using StringT = S;
|
||||
|
||||
protected:
|
||||
//members
|
||||
@ -311,7 +311,7 @@ public:
|
||||
* Make the value type accessible to others.
|
||||
*/
|
||||
|
||||
typedef T ValueT;
|
||||
using ValueT = T;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@ -1056,8 +1056,8 @@ typedef CKeyList<CRegString> CRegStringList;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef CRegDWORDCommon<CRegStdBase> CRegStdDWORD;
|
||||
typedef CRegStringCommon<CRegStdBase> CRegStdString;
|
||||
using CRegStdDWORD = CRegDWORDCommon<CRegStdBase>;
|
||||
using CRegStdString = CRegStringCommon<CRegStdBase>;
|
||||
|
||||
#ifdef _MAP_
|
||||
typedef CKeyList<CRegStdDWORD> CRegStdDWORDList;
|
||||
|
||||
@ -234,9 +234,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef SI_CONVERT_WIN32
|
||||
#ifndef VC_EXTRALEAN
|
||||
#define VC_EXTRALEAN 1
|
||||
#endif
|
||||
//#ifndef VC_EXTRALEAN
|
||||
//#define VC_EXTRALEAN 1
|
||||
//#endif
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
|
||||
@ -220,14 +220,14 @@ struct CCloseIcon
|
||||
};
|
||||
|
||||
// Client code (definitions of standard Windows handles).
|
||||
typedef CSmartHandle<HANDLE, CCloseHandle> CAutoGeneralHandle;
|
||||
typedef CSmartHandle<HKEY, CCloseRegKey> CAutoRegKey;
|
||||
typedef CSmartHandle<PVOID, CCloseViewOfFile> CAutoViewOfFile;
|
||||
typedef CSmartHandle<HMODULE, CCloseLibrary> CAutoLibrary;
|
||||
typedef CSmartHandle<HANDLE, CCloseHandle, CDefaultHandleInvalid> CAutoFile;
|
||||
typedef CSmartHandle<HANDLE, CCloseFindFile, CDefaultHandleInvalid> CAutoFindFile;
|
||||
typedef CSmartHandle<HTHEME, CCloseThemeData> CAutoThemeData;
|
||||
typedef CSmartHandle<HICON, CCloseIcon> CAutoIcon;
|
||||
using CAutoGeneralHandle = CSmartHandle<HANDLE, CCloseHandle>;
|
||||
using CAutoRegKey = CSmartHandle<HKEY, CCloseRegKey>;
|
||||
using CAutoViewOfFile = CSmartHandle<PVOID, CCloseViewOfFile>;
|
||||
using CAutoLibrary = CSmartHandle<HMODULE, CCloseLibrary>;
|
||||
using CAutoFile = CSmartHandle<HANDLE, CCloseHandle, CDefaultHandleInvalid>;
|
||||
using CAutoFindFile = CSmartHandle<HANDLE, CCloseFindFile, CDefaultHandleInvalid>;
|
||||
using CAutoThemeData = CSmartHandle<HTHEME, CCloseThemeData>;
|
||||
using CAutoIcon = CSmartHandle<HICON, CCloseIcon>;
|
||||
|
||||
/*
|
||||
void CompilerTests()
|
||||
|
||||
@ -273,7 +273,7 @@ template <typename T>
|
||||
std::wstring to_bit_wstring(T number, bool trimSignificantClearBits)
|
||||
{
|
||||
// Unsigned version of type given.
|
||||
typedef typename std::make_unsigned<T>::type UT;
|
||||
using UT = typename std::make_unsigned<T>::type;
|
||||
UT one = 1;
|
||||
UT zero = 0;
|
||||
UT uNumber;
|
||||
@ -299,7 +299,7 @@ template <typename T>
|
||||
std::string to_bit_string(T number, bool trimSignificantClearBits)
|
||||
{
|
||||
// Unsigned version of type given.
|
||||
typedef typename std::make_unsigned<T>::type UT;
|
||||
using UT = typename std::make_unsigned<T>::type;
|
||||
UT one = 1;
|
||||
UT zero = 0;
|
||||
UT uNumber;
|
||||
|
||||
@ -37,7 +37,7 @@ public:
|
||||
* RGBA color. Red is in the LSB, Alpha in the MSB.
|
||||
* You can use GetRValue() et al to access individual components.
|
||||
*/
|
||||
typedef DWORD RGBA;
|
||||
using RGBA = DWORD;
|
||||
|
||||
/// Accent color shades
|
||||
struct AccentColor
|
||||
@ -109,9 +109,9 @@ private:
|
||||
HMODULE winrt = nullptr;
|
||||
HMODULE m_winrtString = nullptr;
|
||||
|
||||
typedef HRESULT(STDAPICALLTYPE* PfnWindowsCreateStringReference)(
|
||||
using PfnWindowsCreateStringReference = HRESULT(STDAPICALLTYPE* )(
|
||||
PCWSTR sourceString, UINT32 length, HSTRING_HEADER* hStringHeader, HSTRING* string);
|
||||
PfnWindowsCreateStringReference pWindowsCreateStringReference = nullptr;
|
||||
typedef HRESULT(WINAPI* PfnRoActivateInstance)(HSTRING activatableClassId, IInspectable** instance);
|
||||
using PfnRoActivateInstance = HRESULT(WINAPI* )(HSTRING activatableClassId, IInspectable** instance);
|
||||
PfnRoActivateInstance pRoActivateInstance = nullptr;
|
||||
};
|
||||
|
||||
@ -27,7 +27,7 @@ class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg(HWND hParent);
|
||||
~CAboutDlg();
|
||||
~CAboutDlg() override;
|
||||
|
||||
protected:
|
||||
LRESULT CALLBACK DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
||||
|
||||
@ -31,7 +31,7 @@ class CBookmarksDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CBookmarksDlg(HWND hParent);
|
||||
~CBookmarksDlg(void);
|
||||
~CBookmarksDlg() override;
|
||||
|
||||
void InitBookmarks();
|
||||
std::wstring GetName() const { return m_name; }
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// grepWin - regex search and replace for Windows
|
||||
|
||||
// Copyright (C) 2007-2009, 2012-2013, 2016, 2019-2020 - Stefan Kueng
|
||||
// Copyright (C) 2007-2009, 2012-2013, 2016, 2019-2021 - Stefan Kueng
|
||||
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
@ -19,13 +19,8 @@
|
||||
#pragma once
|
||||
#include <comip.h>
|
||||
#include <comdef.h>
|
||||
#include <comdefsp.h>
|
||||
|
||||
#include <UIRibbon.h>
|
||||
#include <ShlObj.h>
|
||||
#include <Shobjidl.h>
|
||||
#include <activscp.h>
|
||||
#include <UIAutomation.h>
|
||||
#include <spellcheck.h>
|
||||
|
||||
_COM_SMARTPTR_TYPEDEF(IFileOpenDialog, __uuidof(IFileOpenDialog));
|
||||
|
||||
@ -30,7 +30,7 @@ class CMultiLineEditDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CMultiLineEditDlg(HWND hParent);
|
||||
~CMultiLineEditDlg();
|
||||
~CMultiLineEditDlg() override;
|
||||
|
||||
void SetString(const std::wstring& search) { m_regexText = search; }
|
||||
std::wstring GetSearchString() const { return m_regexText; }
|
||||
|
||||
@ -28,7 +28,7 @@ class CNameDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CNameDlg(HWND hParent);
|
||||
~CNameDlg();
|
||||
~CNameDlg() override;
|
||||
|
||||
std::wstring GetName() const { return m_name; }
|
||||
void SetName(const std::wstring& n) { m_name = n; }
|
||||
|
||||
@ -30,7 +30,7 @@ class CRegexTestDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CRegexTestDlg(HWND hParent);
|
||||
~CRegexTestDlg();
|
||||
~CRegexTestDlg() override;
|
||||
|
||||
void SetStrings(const std::wstring& search, const std::wstring& replace);
|
||||
std::wstring GetSearchString() const { return m_searchText; }
|
||||
|
||||
@ -130,6 +130,10 @@
|
||||
<td class="style3">$</td>
|
||||
<td class="style4 td-left">Matches the end of a line</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="style3">\b</td>
|
||||
<td class="style4 td-left">Matches a word boundary. Use this to search for whole words, e.g. <code>\bword\b</code>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="style3">\x{FFFF}</td>
|
||||
<td class="style4 td-left">Matches the unicode character 0xFFFF. Note: this only works for text files!</td>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -89,7 +89,7 @@ class CSearchDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CSearchDlg(HWND hParent);
|
||||
~CSearchDlg();
|
||||
~CSearchDlg() override;
|
||||
|
||||
DWORD SearchThread();
|
||||
DWORD EvaluationThread();
|
||||
|
||||
@ -31,7 +31,7 @@ class CSettingsDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CSettingsDlg(HWND hParent);
|
||||
~CSettingsDlg();
|
||||
~CSettingsDlg() override;
|
||||
|
||||
protected:
|
||||
LRESULT CALLBACK DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) override;
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
#include <unordered_map>
|
||||
#include <functional>
|
||||
|
||||
using ThemeChangeCallback = std::function<void(void)>;
|
||||
using ThemeChangeCallback = std::function<void()>;
|
||||
|
||||
/**
|
||||
* Singleton to handle Theme related methods.
|
||||
|
||||
@ -6,13 +6,13 @@
|
||||
|
||||
//#pragma message(__LOC__"Run the NAnt script to get proper version info")
|
||||
|
||||
#define FILEVER 2, 1, 7, 36
|
||||
#define PRODUCTVER 2, 1, 7, 36
|
||||
#define STRFILEVER "2.1.7.35\0"
|
||||
#define STRPRODUCTVER "2.1.7.35\0"
|
||||
#define FILEVER 2, 1, 7, 37
|
||||
#define PRODUCTVER 2, 1, 7, 37
|
||||
#define STRFILEVER "2.1.7.37\0"
|
||||
#define STRPRODUCTVER "2.1.7.37\0"
|
||||
|
||||
#define GREPWIN_VERMAJOR 2
|
||||
#define GREPWIN_VERMINOR 1
|
||||
#define GREPWIN_VERMICRO 7
|
||||
#define GREPWIN_VERBUILD 36
|
||||
#define GREPWIN_VERDATE "2021-04-07"
|
||||
#define GREPWIN_VERBUILD 37
|
||||
#define GREPWIN_VERDATE "2021-05-14"
|
||||
|
||||
2
grepWinNP3/version.txt
Normal file
2
grepWinNP3/version.txt
Normal file
@ -0,0 +1,2 @@
|
||||
2.0.7.1040
|
||||
https://tools.stefankueng.com/grepWin.html
|
||||
Loading…
Reference in New Issue
Block a user