Commit 13f19887 authored by Ricardo Filipe's avatar Ricardo Filipe Committed by Alexandre Julliard

comdlg32: Send CDN_INCLUDEITEM notification for each object in an Open/Save dialog.

parent bcdf8f6e
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* FIXME: add to recent docs * FIXME: add to recent docs
* *
* FIXME: flags not implemented: OFN_DONTADDTORECENT, * FIXME: flags not implemented: OFN_DONTADDTORECENT,
* OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING, * OFN_ENABLESIZING,
* OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN, * OFN_NODEREFERENCELINKS, OFN_NOREADONLYRETURN,
* OFN_NOTESTFILECREATE, OFN_USEMONIKERS * OFN_NOTESTFILECREATE, OFN_USEMONIKERS
* *
...@@ -82,8 +82,7 @@ ...@@ -82,8 +82,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(commdlg); WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
#define UNIMPLEMENTED_FLAGS \ #define UNIMPLEMENTED_FLAGS \
(OFN_DONTADDTORECENT |\ (OFN_DONTADDTORECENT | OFN_ENABLESIZING |\
OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING |\
OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\ OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\
OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/) OFN_NOTESTFILECREATE /*| OFN_USEMONIKERS*/)
......
...@@ -846,6 +846,47 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBr ...@@ -846,6 +846,47 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBr
return NOERROR; return NOERROR;
} }
/* send_includeitem_notification
*
* Sends a CDN_INCLUDEITEM notification for "pidl" to hwndParentDlg
*/
static LRESULT send_includeitem_notification(HWND hwndParentDlg, LPCITEMIDLIST pidl)
{
LRESULT hook_result = 0;
FileOpenDlgInfos *fodInfos = GetPropA(hwndParentDlg, FileOpenDlgInfosStr);
if(!fodInfos) return 0;
if(fodInfos->DlgInfos.hwndCustomDlg)
{
TRACE("call notify CDN_INCLUDEITEM for pidl=%p\n", pidl);
if(fodInfos->unicode)
{
OFNOTIFYEXW ofnNotify;
ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
ofnNotify.pidl = (LPITEMIDLIST)pidl;
ofnNotify.hdr.hwndFrom = hwndParentDlg;
ofnNotify.hdr.idFrom = 0;
ofnNotify.hdr.code = CDN_INCLUDEITEM;
ofnNotify.lpOFN = fodInfos->ofnInfos;
hook_result = SendMessageW(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
}
else
{
OFNOTIFYEXA ofnNotify;
ofnNotify.psf = fodInfos->Shell.FOIShellFolder;
ofnNotify.pidl = (LPITEMIDLIST)pidl;
ofnNotify.hdr.hwndFrom = hwndParentDlg;
ofnNotify.hdr.idFrom = 0;
ofnNotify.hdr.code = CDN_INCLUDEITEM;
ofnNotify.lpOFN = (LPOPENFILENAMEA)fodInfos->ofnInfos;
hook_result = SendMessageA(fodInfos->DlgInfos.hwndCustomDlg, WM_NOTIFY, 0, (LPARAM)&ofnNotify);
}
}
TRACE("Retval: 0x%08lx\n", hook_result);
return hook_result;
}
/************************************************************************** /**************************************************************************
* IShellBrowserImpl_ICommDlgBrowser_IncludeObject * IShellBrowserImpl_ICommDlgBrowser_IncludeObject
*/ */
...@@ -875,6 +916,11 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBr ...@@ -875,6 +916,11 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBr
if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
return S_OK; return S_OK;
/* if the application takes care of including the item we are done */
if(fodInfos->ofnInfos->Flags & OFN_ENABLEINCLUDENOTIFY &&
send_includeitem_notification(This->hwndOwner, pidl))
return S_OK;
/* Check if there is a mask to apply if not */ /* Check if there is a mask to apply if not */
if(!fodInfos->ShellInfos.lpstrCurrentFilter || !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter)) if(!fodInfos->ShellInfos.lpstrCurrentFilter || !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter))
return S_OK; return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment