Merge remote-tracking branch 'Notepad3_upstream_Rizone/master' into Dev_NewFeatures

This commit is contained in:
Rainer Kottenhoff 2018-11-20 15:12:56 +01:00
commit b6d2587550
2 changed files with 12 additions and 8 deletions

View File

@ -3108,7 +3108,10 @@ void CenterDlgInParent(HWND hDlg)
HWND const hParent = GetParent(hDlg);
RECT rcParent;
GetWindowRect(hParent, &rcParent);
if (hParent)
GetWindowRect(hParent, &rcParent);
else
GetWindowRect(GetDesktopWindow(), &rcParent);
HMONITOR const hMonitor = MonitorFromRect(&rcParent, MONITOR_DEFAULTTONEAREST);
@ -3136,7 +3139,7 @@ void CenterDlgInParent(HWND hDlg)
SetWindowPos(hDlg, NULL, clampi(x, xMin, xMax), clampi(y, yMin, yMax), 0, 0, SWP_NOZORDER | SWP_NOSIZE);
//SnapToDefaultButton(hDlg);
//~SnapToDefaultButton(hDlg);
}

View File

@ -546,12 +546,6 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
// set AppUserModelID
PrivateSetCurrentProcessExplicitAppUserModelID(Settings2.AppUserModelID);
// Command Line Help Dialog
if (s_flagDisplayHelp) {
DisplayCmdLineHelp(NULL);
return 0;
}
// Adapt window class name
if (s_flagIsElevated) {
StringCchCat(s_wchWndClass, COUNTOF(s_wchWndClass), L"U");
@ -642,6 +636,13 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
s_hRichEdit = LoadLibrary(L"MSFTEDIT.DLL"); // Use "RichEdit50W" for control in common_res.h
}
// Command Line Help Dialog
if (s_flagDisplayHelp) {
DisplayCmdLineHelp(NULL);
_CleanUpResources(NULL, false);
return 0;
}
s_msgTaskbarCreated = RegisterWindowMessage(L"TaskbarCreated");
if (!Globals.hDlgIcon) {