comdlg32: Some applications expect the filter combo to be filled before the CustomDlg is created.

oldstable
Aric Stewart 2008-10-21 13:11:23 -05:00 committed by Alexandre Julliard
parent faa956f537
commit 45a352a773
2 changed files with 16 additions and 3 deletions

View File

@ -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);

View File

@ -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();