SmartRename
SmartRename copied to clipboard
Let the dialog appear in the center of the screen
I copied a piece of code, add to "PowerRenameUI.h" After 89 lines
RECT rcDlg;
GetWindowRect(pDlg->m_hwnd, &rcDlg);
RECT rcParent;
HWND hWndParent = GetParent(pDlg->m_hwnd);
GetClientRect(hWndParent, &rcParent);
POINT ptParentInScreen;
ptParentInScreen.x = rcParent.left;
ptParentInScreen.y = rcParent.top;
::ClientToScreen(hWndParent, (LPPOINT)&ptParentInScreen);
SetWindowPos(pDlg->m_hwnd, NULL, ptParentInScreen.x + (rcParent.right - rcParent.left - (rcDlg.right - rcDlg.left)) / 2, ptParentInScreen.y + (rcParent.bottom - rcParent.top - (rcDlg.bottom - rcDlg.top)) / 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
Thanks! I'll experiment with this. I did update the code in the latest release to properly specify the window it was invoked from. https://github.com/chrdavis/SmartRename/releases/tag/v1.0.1