Filedialog location is stored when dialog is closed.
When dialog is reopenned it opens to same location.
Location info is stored as long as the application is running.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40738
-- v4: comdlg32: Filedialog stores location when closed.
From: Janne Kekkonen janne.kekkonen@gmail.com
Filedialog location is stored when dialog is closed. When dialog is reopenned it opens to same location. Location info is stored as long as the application is running.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40738 --- dlls/comdlg32/filedlg.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 43066f02d83..7bcb801d78f 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -132,6 +132,7 @@ typedef struct tagLookInInfo
static const char LookInInfosStr[] = "LookInInfos"; /* LOOKIN combo box property */ static SIZE MemDialogSize = { 0, 0}; /* keep size of the (resizable) dialog */ +static RECT MemDialogPos = {-1, -1, -1, -1}; /* keep the position of the dialog */
FileOpenDlgInfos *get_filedlg_infoptr(HWND hwnd) { @@ -1318,6 +1319,12 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l GetWindowRect( hwnd, &rc ); rc.right += client_adjusted.right - client.right; rc.bottom += client_adjusted.bottom - client.bottom; + + if (MemDialogPos.left<0 && MemDialogPos.top<0) { + MemDialogPos.left=rc.left; + MemDialogPos.top=rc.top; + } + SetWindowPos(hwnd, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE);
@@ -1373,6 +1380,8 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l 0, 0, MemDialogSize.cx, MemDialogSize.cy, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER); } + /*move window*/ + SetWindowPos(hwnd,NULL,MemDialogPos.left, MemDialogPos.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
if(fodInfos->ofnInfos->Flags & OFN_EXPLORER) SendCustomDlgNotificationMessage(hwnd,CDN_SELCHANGE); @@ -1408,6 +1417,8 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l if (fodInfos && fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) MemDialogSize = fodInfos->sizedlg;
+ GetWindowRect(hwnd,&MemDialogPos); + if (places_bar) { himl = (HIMAGELIST)SendDlgItemMessageW(hwnd, IDC_TOOLBARPLACES, TB_GETIMAGELIST, 0, 0);