Module: wine Branch: master Commit: 45a352a7734a373d7992f8387c8e2c372f6653c7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=45a352a7734a373d7992f8387c...
Author: Aric Stewart aric@codeweavers.com Date: Tue Oct 21 13:11:23 2008 -0500
comdlg32: Some applications expect the filter combo to be filled before the CustomDlg is created.
---
dlls/comdlg32/filedlg.c | 7 ++++--- dlls/comdlg32/tests/filedlg.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index dd47528..65d73d2 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -1388,6 +1388,10 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) LoadStringW(COMDLG32_hInstance, IDS_SAVE_IN, buf, sizeof(buf)/sizeof(WCHAR)); SetDlgItemTextW(hwnd, IDC_LOOKINSTATIC, buf); } + + /* Initialize the filter combo box */ + FILEDLG95_FILETYPE_Init(hwnd); + return 0; }
@@ -1476,9 +1480,6 @@ static LRESULT FILEDLG95_FillControls(HWND hwnd, WPARAM wParam, LPARAM lParam) /* Initialize the Look In combo box */ FILEDLG95_LOOKIN_Init(fodInfos->DlgInfos.hwndLookInCB);
- /* Initialize the filter combo box */ - FILEDLG95_FILETYPE_Init(hwnd); - /* Browse to the initial directory */ IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,pidlItemId, SBSP_ABSOLUTE);
diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index 6cfcd17..c3ca118 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -207,6 +207,17 @@ cleanup:
static LONG_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) { + if (msg == WM_INITDIALOG) + { + HWND p,cb; + INT sel; + p = GetParent(dlg); + ok(p!=(HWND)NULL, "Failed to get parent of template\n"); + cb = GetDlgItem(p,0x470); + ok(cb!=(HWND)NULL, "Failed to get filter combobox\n"); + sel = SendMessage(cb, CB_GETCURSEL, 0, 0); + ok (sel != -1, "Failed to get selection from filter listbox\n"); + } if (msg == WM_NOTIFY) { if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) @@ -245,6 +256,7 @@ static void test_create_view_template(void) ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE; ofn.hInstance = GetModuleHandleW(NULL); ofn.lpTemplateName = "template1"; + ofn.lpstrFilter="text\0*.txt\0All\0*\0\0"; ret = GetOpenFileNameA(&ofn); ok(!ret, "GetOpenFileNameA returned %#x\n", ret); ret = CommDlgExtendedError();