if(GetWindowRect(aDlg, &rectDlg))
if(GetWindowPlacement(aDlg, &wndPlacement))
void SaveWindowPosition(HWND aDlg){  RECT rectDlg;  if(GetWindowRect(aDlg, &rectDlg))  {    gSystemInfo.lastWindowPosCenterX = ((rectDlg.right - rectDlg.left) / 2) + rectDlg.left;    gSystemInfo.lastWindowPosCenterY = ((rectDlg.bottom - rectDlg.top) / 2) + rectDlg.top;  }}