Merge pull request #819 from RaiKoHoff/Dev_Fixes4Release

Small fixes for command-line-help dialog
This commit is contained in:
Rainer Kottenhoff 2018-11-20 15:12:18 +01:00 committed by GitHub
commit 4f545fffdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -3137,7 +3137,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);
@ -3165,7 +3168,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

@ -555,12 +555,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");
@ -651,6 +645,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) {