InitDrawingSizes((BoardSize)ibs, 0);
if (boardSize == (BoardSize)-1 &&
winHeight <= screenHeight && winWidth <= screenWidth) {
- boardSize = (BoardSize)ibs;
+ boardSize = (BoardSize)ibs - 4 < 0 ? (BoardSize)0 : (BoardSize)ibs - 4;
}
}
InitDrawingSizes(boardSize, 0);
wp.rcNormalPosition.bottom = consoleY + consoleH;
SetWindowPlacement(hDlg, &wp);
}
+ else { /* Determine Defaults */
+ WINDOWPLACEMENT wp;
+ consoleX = winWidth + 1;
+ consoleY = boardY;
+ consoleW = screenWidth - winWidth;
+ consoleH = winHeight;
+ EnsureOnScreen(&consoleX, &consoleY);
+ wp.length = sizeof(WINDOWPLACEMENT);
+ wp.flags = 0;
+ wp.showCmd = SW_SHOW;
+ wp.ptMaxPosition.x = wp.ptMaxPosition.y = 0;
+ wp.rcNormalPosition.left = consoleX;
+ wp.rcNormalPosition.right = consoleX + consoleW;
+ wp.rcNormalPosition.top = consoleY;
+ wp.rcNormalPosition.bottom = consoleY + consoleH;
+ SetWindowPlacement(hDlg, &wp);
+ }
return FALSE;
case WM_SETFOCUS: