[PATCH v2 0/1] MR9033: comdlg32: Filedialog stores location when closed.
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 -- v2: comdlg32: Filedialog stores location when closed. https://gitlab.winehq.org/wine/wine/-/merge_requests/9033
From: Janne Kekkonen <janne.kekkonen(a)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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 43066f02d83..8b52b744fcd 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,10 @@ 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) + GetWindowRect( hwnd, &MemDialogPos); + SetWindowPos(hwnd, 0, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOMOVE); @@ -1373,6 +1378,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 +1415,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); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9033
I found solution and now there is only the file dialog change -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9033#note_116831
participants (2)
-
Janne Kekkonen -
Janne Kekkonen (@Janne)