[BUG_FIXED] cannot save file(s) if application closed while minimized.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@132 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-02-18 22:07:13 +00:00
parent 93280d508e
commit 62cfd070bf

View File

@ -64,6 +64,14 @@ static void goToCenter(HWND hwnd)
RECT rc;
HWND hParent = ::GetParent(hwnd);
::GetClientRect(hParent, &rc);
//If window coordinates are all zero(ie,window is minimised),then assign desktop as the parent window.
if(rc.left == 0 && rc.right == 0 && rc.top == 0 && rc.bottom == 0)
{
hParent = ::GetDesktopWindow();
::GetClientRect(hParent,&rc);
}
POINT center;
center.x = rc.left + (rc.right - rc.left)/2;
center.y = rc.top + (rc.bottom - rc.top)/2;