Added the 'Center' button and the ability to center the window from the 'Manual editing' dialog.

This commit is contained in:
2023-12-18 18:20:28 +03:00
parent 4228258e80
commit c5b377b22f
3 changed files with 20 additions and 33 deletions

View File

@@ -23,8 +23,6 @@
// wCenterWindow
// wCenterWindow.cpp
// TODO: Add license info into About dialog.
// TODO: Add 'Center' button into Manual Editing dialog.
// TODO: Fix tray icon that disappears after explorer reboot.
// TODO: Split main cpp-file to separate files.
// TODO: Change keyboard low-level hook to RegisterHotKey function.
@@ -528,6 +526,16 @@ INT_PTR CALLBACK DlgProc(HWND hDlg, UINT dlgmsg, WPARAM wParam, LPARAM lParam)
return static_cast<INT_PTR>(TRUE);
break;
}
case IDC_BUTTON_CENTER:
{
logger.Out(L"%s(%d): Pressed the 'Center' button", TEXT(__FUNCTION__), __LINE__);
bKPressed = TRUE;
if (IsWindowApprooved(hFgWnd)) MoveWindowToMonitorCenter(hFgWnd, bWorkArea, FALSE);
else hFgWnd = NULL;
return static_cast<INT_PTR>(TRUE);
break;
}
case IDCANCEL:
case IDC_BUTTON_CLOSE:
{