From: David Hedberg Subject: [PATCH 2/5] comdlg32: Implement calling IFileDialogEvents::OnTypeChange(). Message-Id: <1408840748-21728-2-git-send-email-david.hedberg@gmail.com> Date: Sun, 24 Aug 2014 02:39:05 +0200 --- dlls/comdlg32/itemdlg.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/comdlg32/itemdlg.c b/dlls/comdlg32/itemdlg.c index 2d4f188..1c358f5 100644 --- a/dlls/comdlg32/itemdlg.c +++ b/dlls/comdlg32/itemdlg.c @@ -202,6 +202,18 @@ static void events_OnSelectionChange(FileDialogImpl *This) } } +static void events_OnTypeChange(FileDialogImpl *This) +{ + events_client *cursor; + TRACE("%p\n", This); + + LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry) + { + TRACE("Notifying %p\n", cursor); + IFileDialogEvents_OnTypeChange(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface); + } +} + static inline HRESULT get_cctrl_event(IFileDialogEvents *pfde, IFileDialogControlEvents **pfdce) { return IFileDialogEvents_QueryInterface(pfde, &IID_IFileDialogControlEvents, (void**)pfdce); @@ -1542,6 +1554,8 @@ static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam) update_control_text(This); update_layout(This); + events_OnTypeChange(This); + return TRUE; } @@ -1652,6 +1666,11 @@ static LRESULT on_command_filetype(FileDialogImpl *This, WPARAM wparam, LPARAM l } CoTaskMemFree(filename); } + + /* The documentation claims that OnTypeChange is called only + * when the dialog is opened, but this is obviously not the + * case. */ + events_OnTypeChange(This); } return FALSE; -- 1.9.1