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

Ricardo Filipe ricardojdfilipe at gmail.com
Thu Mar 12 08:42:31 CDT 2009


this patch implements the CDN_INCLUDEITEM notification in a new
function according to MSDN and
to some manual tests i did.
http://msdn.microsoft.com/en-us/library/ms646862.aspx

the notification is sent everytime
IShellBrowserImpl_ICommDlgBrowser_IncludeObject is called, which means one
time per object, and only if OFN_ENABLEINCLUDENOTIFY was sent in the dialog
Flags.

this patch fixes part of http://bugs.winehq.org/show_bug.cgi?id=8072
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090312/de6823e6/attachment.htm>
-------------- next part --------------
From 1593d61536f229a8b6db0f86c25212c7bd65bed8 Mon Sep 17 00:00:00 2001
From: Ricardo Filipe <ricardo_barbano at hotmail.com>
Date: Thu, 12 Mar 2009 13:33:32 +0000
Subject: comdlg32: add SendIncludeItemNotificationMessage function for
 CDN_INCLUDEITEM notification

---
 dlls/comdlg32/filedlg.c        |   38 ++++++++++++++++++++++++++++++++++++++
 dlls/comdlg32/filedlgbrowser.h |    1 +
 2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index a2826c8..881d5eb 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -859,6 +859,44 @@ LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode)
     return hook_result;
 }
 
+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 for CDN_INCLUDEITEM in 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;
+}
+
 static INT_PTR FILEDLG95_Handle_GetFilePath(HWND hwnd, DWORD size, LPVOID result)
 {
     UINT len, total;
diff --git a/dlls/comdlg32/filedlgbrowser.h b/dlls/comdlg32/filedlgbrowser.h
index f8da75e..344c3e8 100644
--- a/dlls/comdlg32/filedlgbrowser.h
+++ b/dlls/comdlg32/filedlgbrowser.h
@@ -162,5 +162,6 @@ extern LPITEMIDLIST     GetParentPidl(LPITEMIDLIST pidl);
 
 extern int     FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl);
 extern LRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
+extern LRESULT SendIncludeItemNotificationMessage(HWND hwndParentDlg, LPCITEMIDLIST pidl);
 
 #endif /*SHBROWSER_H*/
-- 
1.5.6.3


More information about the wine-patches mailing list