commdlg patch

Turkin, Andrey aturkin at mera.ru
Wed Jan 25 11:01:41 CST 2006


Hi!

Here is quick&dirty (TM :) patch (against wine-0.9.6) that changes 
explorer-like Open/Save file dialogs to be more 3.11-like dialog/Windows 
compatible:
1) set view window control id to 1121
2) set inner list window control id to 1 instead of 2000 (anyone know 
why 2000 was chosen?)

This patch is really not very good because of my 1) implementation, but 
it fixes Macromedia Director cast import!
I've done 1) by placing SetWindowLong(hwndView,GWLP_ID, lst2) after each 
IShellBrowser_BrowseObject call. Better approach is to set view vindow's 
control id inside of IShellBrowser_BrowseObject but I don't sure if it safe.

Regards,

  Andrey Turkin.
-------------- next part --------------
diff -cr wine-0.9.6/dlls/commdlg/filedlg.c wine-0.9.6p/dlls/commdlg/filedlg.c
*** wine-0.9.6/dlls/commdlg/filedlg.c	2006-01-19 17:13:54.000000000 +0300
--- wine-0.9.6p/dlls/commdlg/filedlg.c	2006-01-25 19:37:26.000000000 +0300
***************
*** 1486,1491 ****
--- 1486,1492 ----
  
    /* Browse to the initial directory */
    IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,pidlItemId, SBSP_ABSOLUTE);
+   SetWindowLongA(fodInfos->ShellInfos.hwndView, GWLP_ID, lst2);
  
    /* Free pidlItem memory */
    COMDLG32_SHFree(pidlItemId);
***************
*** 1997,2002 ****
--- 1998,2004 ----
  	  if( ! COMDLG32_PIDL_ILIsEqual(pidlCurrent, fodInfos->ShellInfos.pidlAbsCurrent))
  	  {
  	    IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidlCurrent, SBSP_ABSOLUTE);
+ 	    SetWindowLongA(fodInfos->ShellInfos.hwndView, GWLP_ID, lst2);
  	  }
  	  else if( nOpenAction == ONOPEN_SEARCH )
  	  {
***************
*** 2260,2265 ****
--- 2262,2268 ----
                                            NULL,
                                            SBSP_PARENT)))
    {
+     SetWindowLongA(fodInfos->ShellInfos.hwndView, GWLP_ID, lst2);
      SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
      return TRUE;
    }
***************
*** 2282,2287 ****
--- 2285,2291 ----
  
    SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
    hres = IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidl, SBSP_ABSOLUTE);
+   SetWindowLongA(fodInfos->ShellInfos.hwndView, GWLP_ID, lst2);
    SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
    COMDLG32_SHFree(pidl);
    return SUCCEEDED(hres);
***************
*** 2758,2763 ****
--- 2762,2768 ----
                                                tmpFolder->pidlItem,
                                                SBSP_ABSOLUTE)))
        {
+         SetWindowLongA(fodInfos->ShellInfos.hwndView, GWLP_ID, lst2);
          SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
          return TRUE;
        }
***************
*** 3435,3440 ****
--- 3440,3446 ----
                                     ' ','n','o','t',' ','e','x','i','s','t',0};
                 MessageBoxW( hwnd, notexist, fodInfos->title, MB_OK | MB_ICONEXCLAMATION );
            }
+           SetWindowLongA(fodInfos->ShellInfos.hwndView, GWLP_ID, lst2);
            bBrowseSelFolder = TRUE;
            SendCustomDlgNotificationMessage(hwnd,CDN_FOLDERCHANGE);
        }
diff -cr wine-0.9.6/dlls/shell32/shlview.c wine-0.9.6p/dlls/shell32/shlview.c
*** wine-0.9.6/dlls/shell32/shlview.c	2006-01-19 17:14:17.000000000 +0300
--- wine-0.9.6p/dlls/shell32/shlview.c	2006-01-25 19:37:45.000000000 +0300
***************
*** 146,152 ****
  #define IDM_VIEW_IDW    (FCIDM_SHVIEWFIRST + 0x501)
  #define IDM_MYFILEITEM  (FCIDM_SHVIEWFIRST + 0x502)
  
! #define ID_LISTVIEW     2000
  
  #define SHV_CHANGE_NOTIFY WM_USER + 0x1111
  
--- 146,152 ----
  #define IDM_VIEW_IDW    (FCIDM_SHVIEWFIRST + 0x501)
  #define IDM_MYFILEITEM  (FCIDM_SHVIEWFIRST + 0x502)
  
! #define ID_LISTVIEW     1
  
  #define SHV_CHANGE_NOTIFY WM_USER + 0x1111


More information about the wine-devel mailing list