Ricardo Filipe : commdlg: Implemented notifications are only sent with OFN_EXPLORER flag set.

Alexandre Julliard julliard at winehq.org
Wed May 6 10:33:15 CDT 2009


Module: wine
Branch: master
Commit: abadf9a37a7d08fed3e670a521ec14f79e1fb3bf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=abadf9a37a7d08fed3e670a521ec14f79e1fb3bf

Author: Ricardo Filipe <ricardo_barbano at hotmail.com>
Date:   Tue May  5 11:38:34 2009 +0100

commdlg: Implemented notifications are only sent with OFN_EXPLORER flag set.

---

 dlls/comdlg32/filedlg.c        |   32 +++++++++++++++++++++-----------
 dlls/comdlg32/filedlgbrowser.c |    6 ++++--
 2 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c
index b423942..10fccc2 100644
--- a/dlls/comdlg32/filedlg.c
+++ b/dlls/comdlg32/filedlg.c
@@ -1160,9 +1160,12 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
                      0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
          }
 
-         SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
-         SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE);
-         SendCustomDlgNotificationMessage(hwnd,CDN_SELCHANGE);
+         if(fodInfos->ofnInfos->Flags & OFN_EXPLORER)
+         {
+             SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
+             SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE);
+             SendCustomDlgNotificationMessage(hwnd,CDN_SELCHANGE);
+         }
          return 0;
        }
     case WM_SIZE:
@@ -1749,11 +1752,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");
@@ -2148,7 +2152,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);
             }
@@ -2451,7 +2456,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;
@@ -2473,7 +2479,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);
 }
@@ -2651,7 +2658,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*/
@@ -2955,7 +2963,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;
@@ -3629,7 +3638,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;
 }
 




More information about the wine-cvs mailing list