From 62cfd070bfd28e8d690d0ae0f2311008e5e79e58 Mon Sep 17 00:00:00 2001 From: donho Date: Mon, 18 Feb 2008 22:07:13 +0000 Subject: [PATCH] [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 --- .../src/WinControls/OpenSaveFileDialog/FileDialog.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h index 01c5f08f..f451d2a3 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h @@ -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;