[1/2] comdlg32: add SendIncludeItemNotificationMessage function for CDN_INCLUDEITEM notification (try 2)

Ricardo Filipe ricardojdfilipe at gmail.com
Thu Mar 12 19:40:36 CDT 2009


now the function is static and in the file it is used.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090313/9c0555b7/attachment-0001.htm>
-------------- next part --------------
From afb1f0e1c74acb5ce2932747595559ccb0f3c8dc Mon Sep 17 00:00:00 2001
From: Ricardo Filipe <ricardo_barbano at hotmail.com>
Date: Fri, 13 Mar 2009 00:31:35 +0000
Subject: comdlg32: add SendIncludeItemNotificationMessage function for
 CDN_INCLUDEITEM notification

---
 dlls/comdlg32/filedlgbrowser.c |   42 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/dlls/comdlg32/filedlgbrowser.c b/dlls/comdlg32/filedlgbrowser.c
index 704fb98..b3b98f9 100644
--- a/dlls/comdlg32/filedlgbrowser.c
+++ b/dlls/comdlg32/filedlgbrowser.c
@@ -846,6 +846,48 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBr
     return NOERROR;
 }
 
+/*         SendIncludeItemNotificationMessage
+ *
+ * Sends a CDN_INCLUDEITEM notification for "pidl" to hwndParentDlg
+ */
+static LRESULT SendIncludeItemNotificationMessage(HWND hwndParentDlg, LPCITEMIDLIST pidl)
+{
+    LRESULT hook_result = 0;
+    FileOpenDlgInfos *fodInfos = GetPropA(hwndParentDlg, FileOpenDlgInfosStr);
+
+    TRACE("%p\n",hwndParentDlg);
+    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
 */
-- 
1.5.6.3


More information about the wine-patches mailing list