comdlg: implemented notifications are only sent if OFN_EXPLORER is in the dialog flags

Ricardo Filipe ricardojdfilipe at gmail.com
Thu Apr 9 07:15:10 CDT 2009


by MSDN documentation and some manual tests the CDN notifications are only
sent with OFN_EXPLORER.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090409/9f188fa8/attachment.htm>
-------------- next part --------------
From 9d0134ef726889a7e6b06cb23c08b2be6f52b02f Mon Sep 17 00:00:00 2001
From: Ricardo Filipe <ricardo_barbano at hotmail.com>
Date: Thu, 9 Apr 2009 13:10:52 +0100
Subject: comdlg: implemented notifications are only sent if OFN_EXPLORER is in
 the dialog flags

---
 dlls/comdlg32/filedlg.c        |   30 ++++++++++++++++++++----------
 dlls/comdlg32/filedlgbrowser.c |    6 ++++--
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index f7fafff..af5dd8f 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -1007,8 +1007,11 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
          FILEDLG95_ResizeControls(hwnd, wParam, lParam);
       	 FILEDLG95_FillControls(hwnd, wParam, lParam);
 
-         SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
-         SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE);
+         if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+         {
+             SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
+             SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE);
+         }
          return 0;
        }
     case WM_COMMAND:
@@ -1591,11 +1594,12 @@ static BOOL FILEDLG95_SendFileOK( HWND hwnd, FileOpenDlgInfos *fodInfos )
     /* ask the hook if we can close */
     if(IsHooked(fodInfos))
     {
-        LRESULT retval;
+        LRESULT retval = 0;
 
         TRACE("---\n");
         /* First send CDN_FILEOK as MSDN doc says */
-        retval = SendCustomDlgNotificationMessage(hwnd,CDN_FILEOK);
+        if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+            retval = SendCustomDlgNotificationMessage(hwnd,CDN_FILEOK);
         if (GetWindowLongPtrW(fodInfos->DlgInfos.hwndCustomDlg, DWLP_MSGRESULT))
         {
             TRACE("canceled\n");
@@ -1990,7 +1994,8 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
           IPersistFolder2_Release(ppf2);
 	  if( ! COMDLG32_PIDL_ILIsEqual(pidlCurrent, fodInfos->ShellInfos.pidlAbsCurrent))
 	  {
-            if (SUCCEEDED(IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidlCurrent, SBSP_ABSOLUTE)))
+            if (SUCCEEDED(IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidlCurrent, SBSP_ABSOLUTE))
+                && fodInfos->ofnInfos->Flags & OFN_EXPLORER)
             {
               SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
             }
@@ -2293,7 +2298,8 @@ static BOOL FILEDLG95_SHELL_UpFolder(HWND hwnd)
                                           NULL,
                                           SBSP_PARENT)))
   {
-    SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
+    if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+        SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
     return TRUE;
   }
   return FALSE;
@@ -2315,7 +2321,8 @@ static BOOL FILEDLG95_SHELL_BrowseToDesktop(HWND hwnd)
 
   SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
   hres = IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidl, SBSP_ABSOLUTE);
-  SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
+  if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+    SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
   COMDLG32_SHFree(pidl);
   return SUCCEEDED(hres);
 }
@@ -2493,7 +2500,8 @@ static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode)
           len = lstrlenW(lpstrFilter)+1;
           fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc( len * sizeof(WCHAR) );
           lstrcpyW(fodInfos->ShellInfos.lpstrCurrentFilter,lpstrFilter);
-          SendCustomDlgNotificationMessage(hwnd,CDN_TYPECHANGE);
+          if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+              SendCustomDlgNotificationMessage(hwnd,CDN_TYPECHANGE);
       }
 
       /* Refresh the actual view to display the included items*/
@@ -2795,7 +2803,8 @@ static BOOL FILEDLG95_LOOKIN_OnCommand(HWND hwnd, WORD wNotifyCode)
                                               tmpFolder->pidlItem,
                                               SBSP_ABSOLUTE)))
       {
-        SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
+        if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+            SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
         return TRUE;
       }
       break;
@@ -3469,7 +3478,8 @@ static BOOL BrowseSelectedFolder(HWND hwnd)
                MessageBoxW( hwnd, notexist, fodInfos->title, MB_OK | MB_ICONEXCLAMATION );
           }
           bBrowseSelFolder = TRUE;
-          SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE);
+          if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+              SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE);
       }
       COMDLG32_SHFree( pidlSelection );
   }
diff --git a/dlls/comdlg32/filedlgbrowser.c b/dlls/comdlg32/filedlgbrowser.c
index f630f14..078001e 100644
--- a/dlls/comdlg32/filedlgbrowser.c
+++ b/dlls/comdlg32/filedlgbrowser.c
@@ -785,7 +785,8 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDl
 	if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) )
 	{
           hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE);
-          SendCustomDlgNotificationMessage(This->hwndOwner, CDN_FOLDERCHANGE);
+          if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+              SendCustomDlgNotificationMessage(This->hwndOwner, CDN_FOLDERCHANGE);
 	}
         else
 	{
@@ -960,7 +961,8 @@ static HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *if
 
     FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner);
 
-    SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
+    if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+        SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
     return S_OK;
 }
 
-- 
1.5.6.3


More information about the wine-patches mailing list