Ignore:
Timestamp:
Mar 26, 2000, 6:34:57 PM (26 years ago)
Author:
cbratschi
Message:

merged with Corel WINE 20000324

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/filedlg95.c

    r3216 r3243  
     1/* $Id: filedlg95.c,v 1.4 2000-03-26 16:31:41 cbratschi Exp $*/
    12/*
    23 * COMMDLG - File Open Dialogs Win95 look and feel
    34 *
     5 * Copyright 2000 Christoph Bratschi (cbratschi@datacomm.ch)
     6 * Project Odin Software License can be found in LICENSE.TXT
     7 *
     8 * Corel WINE 20000324 level
    49 */
    510#ifdef __WIN32OS2__
     
    4853  CHAR*        szDisplayName;
    4954  INT          iIcon;
     55  INT          iSelIcon;
    5056  HIMAGELIST   ilItemImage;
    5157
     
    173179HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
    174180HRESULT FILEDLG95_HandleCustomDialogMessages(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
     181BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCount, UINT sizeUsed);
     182static BOOL BrowseSelectedFolder(HWND hwnd);
    175183
    176184/***********************************************************************
     
    207215    lRes = DialogBoxIndirectParamA(COMMDLG_hInstance32,
    208216                                  (LPDLGTEMPLATEA) template,
    209                                   fodInfos->ofnInfos.hwndOwner,
     217                                  fodInfos->ofnInfos->hwndOwner,
    210218                                  (DLGPROC) FileOpenDlgProc95,
    211219                                  (LPARAM) fodInfos);
     
    229237BOOL  WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType)
    230238{
    231 
    232239  BOOL ret;
    233240  FileOpenDlgInfos *fodInfos;
     241  HINSTANCE hInstance;
     242  LPCSTR lpstrFilter = NULL;
     243  LPSTR lpstrCustomFilter = NULL;
     244  LPCSTR lpstrInitialDir = NULL;
     245  DWORD dwFlags = 0;
    234246
    235247  /* Initialise FileOpenDlgInfos structure*/
    236248  fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos));
    237   memset(&fodInfos->ofnInfos,'\0',sizeof(*ofn)); fodInfos->ofnInfos.lStructSize = sizeof(*ofn);
    238   fodInfos->ofnInfos.hwndOwner = ofn->hwndOwner;
    239   fodInfos->ofnInfos.hInstance = MapHModuleLS(ofn->hInstance);
     249
     250  /* Pass in the original ofn */
     251  fodInfos->ofnInfos = ofn;
     252
     253  /* Save original hInstance value */
     254  hInstance = ofn->hInstance;
     255  fodInfos->ofnInfos->hInstance = MapHModuleLS(ofn->hInstance);
     256
    240257  if (ofn->lpstrFilter)
    241258  {
    242259    LPSTR s,x;
     260    lpstrFilter = ofn->lpstrFilter;
    243261
    244262    /* filter is a list...  title\0ext\0......\0\0 */
     
    249267    x = (LPSTR)MemAlloc(s-ofn->lpstrFilter);
    250268    memcpy(x,ofn->lpstrFilter,s-ofn->lpstrFilter);
    251     fodInfos->ofnInfos.lpstrFilter = (LPSTR)x;
     269    fodInfos->ofnInfos->lpstrFilter = (LPSTR)x;
    252270  }
    253271  if (ofn->lpstrCustomFilter)
    254272  {
    255273    LPSTR s,x;
     274    lpstrCustomFilter = ofn->lpstrCustomFilter;
    256275
    257276    /* filter is a list...  title\0ext\0......\0\0 */
     
    262281    x = MemAlloc(s-ofn->lpstrCustomFilter);
    263282    memcpy(x,ofn->lpstrCustomFilter,s-ofn->lpstrCustomFilter);
    264     fodInfos->ofnInfos.lpstrCustomFilter = (LPSTR)x;
    265   }
    266   fodInfos->ofnInfos.nMaxCustFilter = ofn->nMaxCustFilter;
    267   fodInfos->ofnInfos.nFilterIndex = ofn->nFilterIndex;
    268   if (ofn->nMaxFile)
    269   {
    270       fodInfos->ofnInfos.lpstrFile = (LPSTR)MemAlloc(ofn->nMaxFile);
    271       strcpy((LPSTR)fodInfos->ofnInfos.lpstrFile,ofn->lpstrFile);
    272   }
    273   fodInfos->ofnInfos.nMaxFile = ofn->nMaxFile;
    274   fodInfos->ofnInfos.nMaxFileTitle = ofn->nMaxFileTitle;
    275     if (fodInfos->ofnInfos.nMaxFileTitle)
    276       fodInfos->ofnInfos.lpstrFileTitle = (LPSTR)MemAlloc(ofn->nMaxFileTitle);
    277   if (ofn->lpstrInitialDir)
    278   {
    279       fodInfos->ofnInfos.lpstrInitialDir = (LPSTR)MemAlloc(strlen(ofn->lpstrInitialDir)+1);
    280       strcpy((LPSTR)fodInfos->ofnInfos.lpstrInitialDir,ofn->lpstrInitialDir);
    281   }
    282 
    283   if (ofn->lpstrTitle)
    284   {
    285       fodInfos->ofnInfos.lpstrTitle = (LPSTR)MemAlloc(strlen(ofn->lpstrTitle)+1);
    286       strcpy((LPSTR)fodInfos->ofnInfos.lpstrTitle,ofn->lpstrTitle);
    287   }
    288 
    289   fodInfos->ofnInfos.Flags = ofn->Flags|OFN_WINE;
    290   fodInfos->ofnInfos.nFileOffset = ofn->nFileOffset;
    291   fodInfos->ofnInfos.nFileExtension = ofn->nFileExtension;
    292   if (ofn->lpstrDefExt)
    293   {
    294       fodInfos->ofnInfos.lpstrDefExt = MemAlloc(strlen(ofn->lpstrDefExt)+1);
    295       strcpy((LPSTR)fodInfos->ofnInfos.lpstrDefExt,ofn->lpstrDefExt);
    296   }
    297   fodInfos->ofnInfos.lCustData = ofn->lCustData;
    298   fodInfos->ofnInfos.lpfnHook = (LPOFNHOOKPROC)ofn->lpfnHook;
    299 
    300   if (HIWORD(ofn->lpTemplateName))
    301   {
    302       fodInfos->ofnInfos.lpTemplateName = MemAlloc(strlen(ofn->lpTemplateName)+1);
    303       strcpy ((LPSTR)fodInfos->ofnInfos.lpTemplateName, ofn->lpTemplateName);
    304   }
    305   else
    306   {
    307       /* resource id */
    308       fodInfos->ofnInfos.lpTemplateName = ofn->lpTemplateName;
    309   }
     283    fodInfos->ofnInfos->lpstrCustomFilter = (LPSTR)x;
     284  }
     285
     286  dwFlags = ofn->Flags;
     287  fodInfos->ofnInfos->Flags = ofn->Flags|OFN_WINE;
    310288
    311289  /* Replace the NULL lpstrInitialDir by the current folder */
    312   if(!ofn->lpstrInitialDir)
    313   {
    314     fodInfos->ofnInfos.lpstrInitialDir = MemAlloc(MAX_PATH);
    315     GetCurrentDirectoryA(MAX_PATH,(LPSTR)fodInfos->ofnInfos.lpstrInitialDir);
     290  lpstrInitialDir = ofn->lpstrInitialDir;
     291  if(!lpstrInitialDir)
     292  {
     293    fodInfos->ofnInfos->lpstrInitialDir = MemAlloc(MAX_PATH);
     294    GetCurrentDirectoryA(MAX_PATH,(LPSTR)fodInfos->ofnInfos->lpstrInitialDir);
    316295  }
    317296
     
    333312  }
    334313
    335   ofn->nFileOffset = fodInfos->ofnInfos.nFileOffset;
    336   ofn->nFileExtension = fodInfos->ofnInfos.nFileExtension;
    337 
    338   /*
    339      Transfer the combo index in the OPENFILENAME structure;
    340      No support for custom filters, so nFilterIndex must be one-based.
    341   */
    342   ofn->nFilterIndex = fodInfos->ofnInfos.nFilterIndex;
    343 
    344   if (fodInfos->ofnInfos.lpstrFilter)
    345       MemFree((LPVOID)(fodInfos->ofnInfos.lpstrFilter));
    346   if (HIWORD(fodInfos->ofnInfos.lpTemplateName))
    347       MemFree((LPVOID)(fodInfos->ofnInfos.lpTemplateName));
    348   if (fodInfos->ofnInfos.lpstrDefExt)
    349       MemFree((LPVOID)(fodInfos->ofnInfos.lpstrDefExt));
    350   if (fodInfos->ofnInfos.lpstrTitle)
    351       MemFree((LPVOID)(fodInfos->ofnInfos.lpstrTitle));
    352   if (fodInfos->ofnInfos.lpstrInitialDir)
    353       MemFree((LPVOID)(fodInfos->ofnInfos.lpstrInitialDir));
    354   if (fodInfos->ofnInfos.lpstrCustomFilter)
    355       MemFree((LPVOID)(fodInfos->ofnInfos.lpstrCustomFilter));
    356 
    357   if (fodInfos->ofnInfos.lpstrFile)
    358   {
    359       /*
    360        * We have to clear the buffer before we copy the filename since we don't
    361        * support selecting multiple files. We have to make sure that the caller won't
    362        * attempt to read past the first filename.
    363        */
    364       memset(ofn->lpstrFile, '\0', ofn->nMaxFile);
    365       strcpy(ofn->lpstrFile,fodInfos->ofnInfos.lpstrFile);
    366       MemFree((LPVOID)fodInfos->ofnInfos.lpstrFile);
    367   }
    368   if (fodInfos->ofnInfos.lpstrFileTitle)
    369     {
    370       if (ofn->lpstrFileTitle)
    371           strcpy(ofn->lpstrFileTitle,
    372                  fodInfos->ofnInfos.lpstrFileTitle);
    373       MemFree((LPVOID)fodInfos->ofnInfos.lpstrFileTitle);
     314  if (lpstrInitialDir)
     315  {
     316    MemFree((LPVOID)(fodInfos->ofnInfos->lpstrInitialDir));
     317    fodInfos->ofnInfos->lpstrInitialDir = lpstrInitialDir;
    374318      }
    375 
     319  if (lpstrFilter)
     320  {
     321    MemFree((LPVOID)(fodInfos->ofnInfos->lpstrFilter));
     322    fodInfos->ofnInfos->lpstrFilter = lpstrFilter;
     323  }
     324  if (lpstrCustomFilter)
     325  {
     326    MemFree((LPVOID)(fodInfos->ofnInfos->lpstrCustomFilter));
     327    fodInfos->ofnInfos->lpstrCustomFilter = lpstrCustomFilter;
     328  }
     329
     330  ofn->Flags = dwFlags;
     331  ofn->hInstance = hInstance;
    376332  MemFree((LPVOID)(fodInfos));
    377333  return ret;
     
    391347  BOOL ret;
    392348  FileOpenDlgInfos *fodInfos;
     349  HINSTANCE hInstance;
     350  LPCSTR lpstrFilter = NULL;
     351  LPSTR lpstrCustomFilter = NULL;
     352  DWORD dwFlags;
    393353
    394354  /* Initialise FileOpenDlgInfos structure*/
    395355  fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos));
    396   memset(&fodInfos->ofnInfos,'\0',sizeof(*ofn));
    397   fodInfos->ofnInfos.lStructSize = sizeof(*ofn);
    398   fodInfos->ofnInfos.hwndOwner = ofn->hwndOwner;
    399   fodInfos->ofnInfos.hInstance = MapHModuleLS(ofn->hInstance);
     356
     357  /*  Pass in the original ofn */
     358  fodInfos->ofnInfos = (LPOPENFILENAMEA)ofn;
     359
     360  /* Save hInstance */
     361  hInstance = fodInfos->ofnInfos->hInstance;
     362  fodInfos->ofnInfos->hInstance = MapHModuleLS(ofn->hInstance);
     363
     364  /* Save lpstrFilter */
    400365  if (ofn->lpstrFilter)
    401366  {
     
    403368    LPSTR x,y;
    404369    int n;
     370
     371    lpstrFilter = fodInfos->ofnInfos->lpstrFilter;
    405372
    406373    /* filter is a list...  title\0ext\0......\0\0 */
     
    419386    }
    420387    *x=0;
    421     fodInfos->ofnInfos.lpstrFilter = (LPSTR)y;
    422   }
    423   if (ofn->lpstrCustomFilter) {
     388    fodInfos->ofnInfos->lpstrFilter = (LPSTR)y;
     389  }
     390  /* Save lpstrCustomFilter */
     391  if (ofn->lpstrCustomFilter)
     392  {
    424393    LPWSTR  s;
    425394    LPSTR x,y;
    426395    int n;
    427396
     397    lpstrCustomFilter = fodInfos->ofnInfos->lpstrCustomFilter;
    428398    /* filter is a list...  title\0ext\0......\0\0 */
    429399    s = (LPWSTR)ofn->lpstrCustomFilter;
     
    440410    }
    441411    *x=0;
    442     fodInfos->ofnInfos.lpstrCustomFilter = (LPSTR)y;
    443   }
    444   fodInfos->ofnInfos.nMaxCustFilter = ofn->nMaxCustFilter;
    445   fodInfos->ofnInfos.nFilterIndex = ofn->nFilterIndex;
    446   if (ofn->nMaxFile)
    447      fodInfos->ofnInfos.lpstrFile = (LPSTR)MemAlloc(ofn->nMaxFile);
    448   fodInfos->ofnInfos.nMaxFile = ofn->nMaxFile;
    449   fodInfos->ofnInfos.nMaxFileTitle = ofn->nMaxFileTitle;
    450   if (ofn->nMaxFileTitle)
    451     fodInfos->ofnInfos.lpstrFileTitle = (LPSTR)MemAlloc(ofn->nMaxFileTitle);
    452   if (ofn->lpstrInitialDir)
    453   {
    454     fodInfos->ofnInfos.lpstrInitialDir = (LPSTR)MemAlloc(lstrlenW(ofn->lpstrInitialDir)+1);
    455     lstrcpyWtoA((LPSTR)fodInfos->ofnInfos.lpstrInitialDir,ofn->lpstrInitialDir);
    456   }
    457   if (ofn->lpstrTitle)
    458   {
    459     fodInfos->ofnInfos.lpstrTitle = (LPSTR)MemAlloc(lstrlenW(ofn->lpstrTitle)+1);
    460     lstrcpyWtoA((LPSTR)fodInfos->ofnInfos.lpstrTitle,ofn->lpstrTitle);
    461   }
    462   fodInfos->ofnInfos.Flags = ofn->Flags|OFN_WINE|OFN_UNICODE;
    463   fodInfos->ofnInfos.nFileOffset = ofn->nFileOffset;
    464   fodInfos->ofnInfos.nFileExtension = ofn->nFileExtension;
    465   if (ofn->lpstrDefExt)
    466   {
    467     fodInfos->ofnInfos.lpstrDefExt = (LPSTR)MemAlloc(lstrlenW(ofn->lpstrDefExt)+1);
    468     lstrcpyWtoA((LPSTR)fodInfos->ofnInfos.lpstrDefExt,ofn->lpstrDefExt);
    469   }
    470   fodInfos->ofnInfos.lCustData = ofn->lCustData;
    471   fodInfos->ofnInfos.lpfnHook = (LPOFNHOOKPROC)ofn->lpfnHook;
    472 
    473   if (HIWORD(ofn->lpTemplateName))
    474   {
    475     fodInfos->ofnInfos.lpTemplateName = (LPSTR)MemAlloc(lstrlenW(ofn->lpTemplateName)+1);
    476     lstrcpyWtoA((LPSTR)fodInfos->ofnInfos.lpTemplateName,ofn->lpTemplateName);
    477   }
    478   else
    479   {
    480       /* resource id */
    481       fodInfos->ofnInfos.lpTemplateName = (LPSTR)ofn->lpTemplateName;
    482   }
     412    fodInfos->ofnInfos->lpstrCustomFilter = (LPSTR)y;
     413  }
     414
     415  /* Save Flags */
     416  dwFlags = fodInfos->ofnInfos->Flags;
     417  fodInfos->ofnInfos->Flags = ofn->Flags|OFN_WINE|OFN_UNICODE;
     418
    483419  /* Initialise the dialog property */
    484420  fodInfos->DlgInfos.dwDlgProp = 0;
     
    498434
    499435  /* Cleaning */
    500   ofn->nFileOffset = fodInfos->ofnInfos.nFileOffset;
    501   ofn->nFileExtension = fodInfos->ofnInfos.nFileExtension;
    502 
    503   /*
    504      Transfer the combo index in the OPENFILENAME structure;
    505      No support for custom filters, so nFilterIndex must be one-based.
    506   */
    507   ofn->nFilterIndex = fodInfos->ofnInfos.nFilterIndex;
    508 
    509   if (fodInfos->ofnInfos.lpstrFilter)
    510     MemFree((LPVOID)(fodInfos->ofnInfos.lpstrFilter));
    511   if (HIWORD(fodInfos->ofnInfos.lpTemplateName))
    512     MemFree((LPVOID)(fodInfos->ofnInfos.lpTemplateName));
    513   if (fodInfos->ofnInfos.lpstrDefExt)
    514     MemFree((LPVOID)(fodInfos->ofnInfos.lpstrDefExt));
    515   if (fodInfos->ofnInfos.lpstrTitle)
    516     MemFree((LPVOID)(fodInfos->ofnInfos.lpstrTitle));
    517   if (fodInfos->ofnInfos.lpstrInitialDir)
    518     MemFree((LPVOID)(fodInfos->ofnInfos.lpstrInitialDir));
    519   if (fodInfos->ofnInfos.lpstrCustomFilter)
    520     MemFree((LPVOID)(fodInfos->ofnInfos.lpstrCustomFilter));
    521 
    522   if (fodInfos->ofnInfos.lpstrFile)
    523   {
    524       /*
    525        * We have to clear the buffer before we copy the filename since we don't
    526        * support selecting multiple files. We have to make sure that the caller won't
    527        * attempt to read past the first filename.
    528        */
    529       memset(ofn->lpstrFile, '\0', ofn->nMaxFile * sizeof(WCHAR) );
    530       lstrcpyAtoW(ofn->lpstrFile,(fodInfos->ofnInfos.lpstrFile));
    531       MemFree((LPVOID)(fodInfos->ofnInfos.lpstrFile));
    532   }
    533 
    534   if (fodInfos->ofnInfos.lpstrFileTitle) {
    535       if (ofn->lpstrFileTitle)
    536                 lstrcpyAtoW(ofn->lpstrFileTitle,
    537       (fodInfos->ofnInfos.lpstrFileTitle));
    538       MemFree((LPVOID)(fodInfos->ofnInfos.lpstrFileTitle));
    539   }
     436  /* Restore Flags */
     437  fodInfos->ofnInfos->Flags = dwFlags;
     438
     439  /* Restore lpstrFilter */
     440  if (fodInfos->ofnInfos->lpstrFilter)
     441  {
     442    MemFree((LPVOID)(fodInfos->ofnInfos->lpstrFilter));
     443    fodInfos->ofnInfos->lpstrFilter = lpstrFilter;
     444  }
     445  if (fodInfos->ofnInfos->lpstrCustomFilter)
     446  {
     447    MemFree((LPVOID)(fodInfos->ofnInfos->lpstrCustomFilter));
     448    fodInfos->ofnInfos->lpstrCustomFilter = lpstrCustomFilter;
     449  }
     450
     451  /* Restore hInstance */
     452  fodInfos->ofnInfos->hInstance = hInstance;
    540453  MemFree((LPVOID)(fodInfos));
    541454  return ret;
    542 
    543455}
    544456
     
    688600                lParam = (LPARAM) &fodInfos->ofnInfos;
    689601                ArrangeCtrlPositions(hwnd,GetParent(hwnd));
    690             if(fodInfos && (fodInfos->ofnInfos.Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos.lpfnHook)
    691                  return CallWindowProcA((WNDPROC)fodInfos->ofnInfos.lpfnHook,hwnd,uMsg,wParam,lParam);
     602            if(fodInfos && (fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook)
     603                 return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam);
    692604                return 0;
    693605        }
    694606    }
    695     if(fodInfos && (fodInfos->ofnInfos.Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos.lpfnHook )
    696         return CallWindowProcA((WNDPROC)fodInfos->ofnInfos.lpfnHook,hwnd,uMsg,wParam,lParam);
     607    if(fodInfos && (fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook )
     608        return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam);
    697609  return DefWindowProcA(hwnd,uMsg,wParam,lParam);
    698610}
     
    704616    HANDLE hDlgTmpl = 0;
    705617    HWND hChildDlg = 0;
    706    if (fodInfos->ofnInfos.Flags & OFN_ENABLETEMPLATE || fodInfos->ofnInfos.Flags & OFN_ENABLETEMPLATEHANDLE)
     618   if (fodInfos->ofnInfos->Flags & OFN_ENABLETEMPLATE || fodInfos->ofnInfos->Flags & OFN_ENABLETEMPLATEHANDLE)
    707619   {
    708         if (fodInfos->ofnInfos.Flags  & OFN_ENABLETEMPLATEHANDLE)
     620        if (fodInfos->ofnInfos->Flags  & OFN_ENABLETEMPLATEHANDLE)
    709621        {
    710            if( !(template = LockResource( fodInfos->ofnInfos.hInstance)))
     622           if( !(template = LockResource( fodInfos->ofnInfos->hInstance)))
    711623                {
    712624                COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
     
    717629        else
    718630        {
    719          if (!(hRes = FindResourceA(MapHModuleSL(fodInfos->ofnInfos.hInstance),
    720             (fodInfos->ofnInfos.lpTemplateName), RT_DIALOGA)))
     631         if (!(hRes = FindResourceA(MapHModuleSL(fodInfos->ofnInfos->hInstance),
     632            (fodInfos->ofnInfos->lpTemplateName), RT_DIALOGA)))
    721633        {
    722634                COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
    723635                 return (HWND)NULL;
    724636        }
    725         if (!(hDlgTmpl = LoadResource( MapHModuleSL(fodInfos->ofnInfos.hInstance),
     637        if (!(hDlgTmpl = LoadResource( MapHModuleSL(fodInfos->ofnInfos->hInstance),
    726638             hRes )) ||
    727639                 !(template = LockResource( hDlgTmpl )))
     
    732644        }
    733645
    734         hChildDlg= CreateDialogIndirectParamA(fodInfos->ofnInfos.hInstance,template,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
     646        hChildDlg= CreateDialogIndirectParamA(fodInfos->ofnInfos->hInstance,template,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
    735647        if(hChildDlg)
    736648        {
     
    739651        }
    740652 }
    741  else if(fodInfos->ofnInfos.Flags & OFN_ENABLEHOOK && fodInfos->ofnInfos.lpfnHook)
     653 else if(fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK && fodInfos->ofnInfos->lpfnHook)
    742654 {
    743655        RECT rectHwnd;
     
    752664        tmplate.cy = rectHwnd.bottom-rectHwnd.top;
    753665
    754         return CreateDialogIndirectParamA(fodInfos->ofnInfos.hInstance,&tmplate,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
     666        return CreateDialogIndirectParamA(fodInfos->ofnInfos->hInstance,&tmplate,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
    755667 }
    756668return (HWND)NULL;
     
    774686        ofnNotify.hdr.idFrom=0;
    775687        ofnNotify.hdr.code = uCode;
    776         ofnNotify.lpOFN = &fodInfos->ofnInfos;
     688        ofnNotify.lpOFN = fodInfos->ofnInfos;
    777689        return SendMessageA(fodInfos->DlgInfos.hwndCustomDlg,WM_NOTIFY,0,(LPARAM)&ofnNotify);
    778690    }
     
    788700{
    789701    LPSTR lpstrFileSpec;
    790     int reqSize;
    791     char lpstrPath[MAX_PATH];
     702    char lpstrCurrentDir[MAX_PATH]="";
    792703    FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
    793704    if(!fodInfos)
    794         return -1;
     705        return TRUE;
    795706    switch(uMsg)
    796707    {
    797708        case CDM_GETFILEPATH:
     709        {
     710            char lpstrPathSpec[MAX_PATH]="";
     711            GetDlgItemTextA(hwnd,IDC_FILENAME,(LPSTR)lParam, (int)wParam);
     712            lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA((LPSTR)lParam);
     713            strcpy(lpstrPathSpec,(LPSTR)lParam);
     714            COMDLG32_PathRemoveFileSpecA(lpstrPathSpec);
     715            if(!lpstrPathSpec[0])
     716                COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,
     717                lpstrPathSpec);
     718            strcat(lpstrPathSpec,"\\");
     719            strcat(lpstrPathSpec,(LPSTR)lParam);
     720            strcpy((LPSTR)lParam,(LPSTR)lpstrPathSpec);
     721        }
     722            return TRUE;
     723        case CDM_GETFOLDERPATH:
     724            if(lParam)
    798725            {
    799             GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath));
    800             lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA(lpstrPath);
    801             if (lpstrFileSpec==lpstrPath) {
    802                 char lpstrCurrentDir[MAX_PATH];
    803                 /* Prepend the current path */
    804                 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrCurrentDir);
    805                 if ((LPSTR)lParam!=NULL)
    806                     wsnprintfA((LPSTR)lParam,(int)wParam,"%s\\%s",lpstrCurrentDir,lpstrPath);
    807                 reqSize=strlen(lpstrCurrentDir)+1+strlen(lpstrPath)+1;
    808             } else {
    809                 lstrcpynA((LPSTR)lParam,(LPSTR)lpstrPath,(int)wParam);
    810                 reqSize=strlen(lpstrPath);
     726                if(fodInfos)
     727                {
     728                    COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,
     729                    lpstrCurrentDir);
     730                    strncpy((LPSTR)lParam,lpstrCurrentDir,(int)wParam);
    811731                }
     732                else
     733                *((LPSTR)lParam)=0;
    812734            }
    813             /* return the required buffer size */
    814             return reqSize;
    815         case CDM_GETFOLDERPATH:
    816             COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
    817             if ((LPSTR)lParam!=NULL)
    818                 lstrcpynA((LPSTR)lParam,lpstrPath,(int)wParam);
    819             return strlen(lpstrPath);
     735            return TRUE;
    820736    case CDM_GETSPEC:
    821             reqSize=GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath));
    822             lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA(lpstrPath);
    823             if ((LPSTR)lParam!=NULL)
    824                 lstrcpynA((LPSTR)lParam, lpstrFileSpec, (int)wParam);
    825             return strlen(lpstrFileSpec);
     737            if(lParam)
     738            {
     739                GetDlgItemTextA(hwnd,IDC_FILENAME,(LPSTR)lParam, (int)wParam);
     740                lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA((LPSTR)lParam);
     741                if(lpstrFileSpec)
     742                   strcpy((LPSTR)lParam, lpstrFileSpec);
     743                else
     744                    *((LPSTR)lParam)=0;
     745            }
     746            return TRUE;
     747        case CDM_SETCONTROLTEXT:
     748          if ( 0 != lParam )
     749            SetDlgItemTextA( hwnd, (UINT) wParam, (LPSTR) lParam );
     750          return TRUE;
    826751        case CDM_HIDECONTROL:
    827         case CDM_SETCONTROLTEXT:
    828752        case CDM_SETDEFEXT:
    829753        FIXME("CDM_HIDECONTROL,CDM_SETCONTROLTEXT,CDM_SETDEFEXT not implemented\n");
    830754        return TRUE;
    831755    }
    832     return -1;
     756    return TRUE;
    833757}
    834758
     
    869793
    870794  case WM_DESTROY:
    871       RemovePropA(hwnd, FileOpenDlgInfosStr);
     795        FILEDLG95_Clean(hwnd);
     796        RemovePropA(hwnd, FileOpenDlgInfosStr);
     797        return FALSE;
     798
     799    case WM_NOTIFY:
     800    {
     801        LPNMHDR lpnmh = (LPNMHDR)lParam;
     802        UINT stringId = -1;
     803
     804        /* set up the button tooltips strings */
     805        if(TTN_GETDISPINFOA == lpnmh->code )
     806        {
     807            LPNMTTDISPINFOA lpdi = (LPNMTTDISPINFOA)lParam;
     808            switch(lpnmh->idFrom )
     809            {
     810                /* Up folder button */
     811                case FCIDM_TB_UPFOLDER:
     812                    stringId = IDS_UPFOLDER;
     813                    break;
     814                /* New folder button */
     815                case FCIDM_TB_NEWFOLDER:
     816                    stringId = IDS_NEWFOLDER;
     817                    break;
     818                /* List option button */
     819                case FCIDM_TB_SMALLICON:
     820                    stringId = IDS_LISTVIEW;
     821                    break;
     822                /* Details option button */
     823                case FCIDM_TB_REPORTVIEW:
     824                    stringId = IDS_REPORTVIEW;
     825                    break;
     826            }
     827            lpdi->hinst = COMMDLG_hInstance32;
     828            lpdi->lpszText =  (LPSTR) stringId;
     829        }
     830        return FALSE;
     831    }
    872832
    873833    default :
     
    887847  LPITEMIDLIST pidlItemId;
    888848  FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) lParam;
     849  DWORD count;
    889850
    890851  TRACE("\n");
     
    894855  InitCommonControls();
    895856#endif
    896 
     857//MessageBox(hwnd,"WM_INITDIALOG",NULL,MB_OK);
     858dprintf(("CB: FILEDLG95_SHELL_Init"));
     859count = GetTickCount();
    897860  /* Initialise shell objects */
    898861  FILEDLG95_SHELL_Init(hwnd);
    899 
     862dprintf(("CB: FILEDLG95_InitUI %d ms",GetTickCount()-count));
     863count = GetTickCount();
    900864  /* Initialise dialog UI */
    901865  FILEDLG95_InitUI(hwnd);
    902 
     866dprintf(("CB: FILEDLG95_LOOKIN_Init %d",GetTickCount()-count));
     867count = GetTickCount();
    903868  /* Initialize the Look In combo box*/
    904869  FILEDLG95_LOOKIN_Init(fodInfos->DlgInfos.hwndLookInCB);
    905 
     870dprintf(("CB: FILEDLG95_FILETYPE_Init %d",GetTickCount()-count));
     871count = GetTickCount();
    906872  /* Initialize the filter combo box */
    907873  FILEDLG95_FILETYPE_Init(hwnd);
    908 
     874dprintf(("CB: FILEDLG95_FILETYPE_Init done %d",GetTickCount()-count));
     875count = GetTickCount();
    909876  /* Get the initial directory pidl */
    910877
    911   if(!(pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder,fodInfos->ofnInfos.lpstrInitialDir)))
     878  if(!(pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder,fodInfos->ofnInfos->lpstrInitialDir)))
    912879  {
    913880    char path[MAX_PATH];
     
    918885
    919886  }
    920 
     887dprintf(("CB: IShellBrowser_BrowseObject %d",GetTickCount()-count));
     888count = GetTickCount();
    921889  /* Browse to the initial directory */
    922890  IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,pidlItemId,SBSP_RELATIVE);
    923 
     891dprintf(("CB: done WM_INITDIALOG %d",GetTickCount()-count));
    924892  /* Free pidlItem memory */
    925893  COMDLG32_SHFree(pidlItemId);
     
    958926    /* Cancel button */
    959927  case IDCANCEL:
    960       FILEDLG95_Clean(hwnd);
    961928      EndDialog(hwnd, FALSE);
    962929    break;
     
    10641031
    10651032  /* Set the window text with the text specified in the OPENFILENAME structure */
    1066   if(fodInfos->ofnInfos.lpstrTitle)
    1067   {
    1068       SetWindowTextA(hwnd,fodInfos->ofnInfos.lpstrTitle);
     1033  if(fodInfos->ofnInfos->lpstrTitle)
     1034  {
     1035      SetWindowTextA(hwnd,fodInfos->ofnInfos->lpstrTitle);
    10691036  }
    10701037  else if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
     
    10741041
    10751042  /* Initialise the file name edit control */
    1076   if(fodInfos->ofnInfos.lpstrFile)
    1077   {
    1078       SetDlgItemTextA(hwnd,IDC_FILENAME,fodInfos->ofnInfos.lpstrFile);
    1079   }
     1043  if(fodInfos->ofnInfos->lpstrFile)
     1044  {
     1045      /**
     1046       * When passed a fully qualified filename, windows removes
     1047       * the path component, before showing it in the control
     1048       */
     1049      LPSTR lpstrFileName = NULL;
     1050
     1051      lpstrFileName = (LPSTR)COMDLG32_PathFindFilenameA(fodInfos->ofnInfos->lpstrFile);
     1052      if(NULL != lpstrFileName)
     1053          SetDlgItemTextA(hwnd,IDC_FILENAME,lpstrFileName);
     1054      else
     1055          SetDlgItemTextA(hwnd,IDC_FILENAME,"");
     1056  }
     1057
    10801058  /* Must the open as read only check box be checked ?*/
    1081   if(fodInfos->ofnInfos.Flags & OFN_READONLY)
     1059  if(fodInfos->ofnInfos->Flags & OFN_READONLY)
    10821060  {
    10831061    SendDlgItemMessageA(hwnd,IDC_OPENREADONLY,BM_SETCHECK,(WPARAM)TRUE,0);
    10841062  }
    10851063  /* Must the open as read only check box be hid ?*/
    1086   if(fodInfos->ofnInfos.Flags & OFN_HIDEREADONLY)
     1064  if(fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY)
    10871065  {
    10881066    ShowWindow(GetDlgItem(hwnd,IDC_OPENREADONLY),SW_HIDE);
     1067  }
     1068  /* Must the help button be hid ?*/
     1069  if (!(fodInfos->ofnInfos->Flags & OFN_SHOWHELP))
     1070  {
     1071    ShowWindow(GetDlgItem(hwnd, pshHelp), SW_HIDE);
     1072  }
     1073  /* Resize the height, if open as read only checkbox ad help button
     1074     are hidden */
     1075  if ( (fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY) &&
     1076       (!(fodInfos->ofnInfos->Flags & OFN_SHOWHELP)) )
     1077  {
     1078    RECT rectDlg, rectHelp, rectCancel;
     1079    GetWindowRect(hwnd, &rectDlg);
     1080    GetWindowRect(GetDlgItem(hwnd, pshHelp), &rectHelp);
     1081    GetWindowRect(GetDlgItem(hwnd, IDCANCEL), &rectCancel);
     1082    /* subtract the height of the help button plus the space between
     1083       the help button and the cancel button to the height of the dialog */
     1084    SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left,
     1085                 (rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom),
     1086                 SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER);
    10891087  }
    10901088  /* change Open to Save */
     
    10921090  {
    10931091      SetDlgItemTextA(hwnd,IDOK,"Save");
     1092      SetDlgItemTextA(hwnd,IDC_LOOKINSTATIC,"Save &in");
    10941093  }
    10951094  return 0;
     
    10971096
    10981097/***********************************************************************
     1098 *      FILEDLG95_OnOpenMultipleFiles
     1099 *
     1100 * Handles the opening of multiple files.
     1101 *
     1102*/
     1103BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCount, UINT sizeUsed)
     1104{
     1105  CHAR   lpstrPathSpec[MAX_PATH] = "";
     1106  CHAR   lpstrTempFileList[MAX_PATH] = "";
     1107  LPSTR  lpstrFile;
     1108  UINT   sizePath;
     1109  UINT   nCount;
     1110  FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
     1111
     1112  TRACE("\n");
     1113
     1114  lpstrFile = fodInfos->ofnInfos->lpstrFile;
     1115
     1116  COMDLG32_SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec );
     1117  sizePath = lstrlenA( lpstrPathSpec );
     1118
     1119  memset( lpstrFile, 0x0, fodInfos->ofnInfos->nMaxFile * sizeof(CHAR) );
     1120
     1121  if ( fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST ||
     1122          !(fodInfos->ofnInfos->Flags & OFN_EXPLORER ))
     1123          {
     1124      LPSTR lpstrTemp = lpstrFileList;
     1125
     1126      for ( nCount = 0; nCount < nFileCount; nCount++ )
     1127      {
     1128          WIN32_FIND_DATAA findData;
     1129          CHAR lpstrFindFile[MAX_PATH];
     1130
     1131          memset( lpstrFindFile, 0x0, MAX_PATH * sizeof(CHAR) );
     1132
     1133          lstrcpyA( lpstrFindFile, lpstrPathSpec );
     1134          lstrcatA( lpstrFindFile, "\\" );
     1135          lstrcatA( lpstrFindFile, lpstrTemp );
     1136
     1137          if ( FindFirstFileA( lpstrFindFile, &findData ) == INVALID_HANDLE_VALUE )
     1138          {
     1139              CHAR lpstrNotFound[100];
     1140              CHAR lpstrMsg[100];
     1141              CHAR tmp[400];
     1142
     1143              LoadStringA(COMMDLG_hInstance32, IDS_FILENOTFOUND, lpstrNotFound, 100);
     1144              LoadStringA(COMMDLG_hInstance32, IDS_VERIFYFILE, lpstrMsg, 100);
     1145
     1146              strcpy(tmp, lpstrFindFile);
     1147              strcat(tmp, "\n");
     1148              strcat(tmp, lpstrNotFound);
     1149              strcat(tmp, "\n");
     1150              strcat(tmp, lpstrMsg);
     1151
     1152              MessageBoxA(hwnd,
     1153                      tmp,
     1154                      fodInfos->ofnInfos->lpstrTitle,
     1155                      MB_OK | MB_ICONEXCLAMATION);
     1156              return FALSE;
     1157  }
     1158
     1159          if (!(fodInfos->ofnInfos->Flags & OFN_EXPLORER ))
     1160  {
     1161              lstrcatA( lpstrTempFileList, findData.cAlternateFileName);
     1162              if ( nCount + 1 < nFileCount)
     1163                  lstrcatA( lpstrTempFileList, " ");
     1164  }
     1165          lpstrTemp += strlen(lpstrFileList) + 1;
     1166      }
     1167  }
     1168
     1169      if ( fodInfos->ofnInfos->Flags & OFN_EXPLORER )
     1170      {
     1171      lstrcpyA( lpstrFile, lpstrPathSpec);
     1172      memcpy( lpstrFile + sizePath + 1, lpstrFileList, sizeof(CHAR) * sizeUsed );
     1173      }
     1174      else
     1175      {
     1176      memcpy( lpstrFile, lpstrTempFileList, sizeof(CHAR) * strlen(lpstrTempFileList));
     1177      }
     1178
     1179      fodInfos->ofnInfos->nFileOffset = sizePath + 1;
     1180      fodInfos->ofnInfos->nFileExtension = 0;
     1181
     1182  /* clean and exit */
     1183  return EndDialog(hwnd,TRUE);
     1184}
     1185
     1186/***********************************************************************
    10991187 *      FILEDLG95_OnOpen
    11001188 *
     
    11051193BOOL FILEDLG95_OnOpen(HWND hwnd)
    11061194{
    1107   char lpstrSpecifiedByUser[MAX_PATH];
     1195  CHAR lpstrSpecifiedByUser[MAX_PATH] = "";
     1196  CHAR lpstrFileList[MAX_PATH] = "";
     1197  LPSTR lpstrFile;
     1198  UINT nStrCharCount = 0;
     1199  UINT nFileCount = 0;
     1200  UINT nFileIndex = 0;
     1201  UINT sizeUsed = 0;
     1202  UINT nStrLen = 0;
     1203
    11081204  FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
    1109   LPITEMIDLIST pidlSelection;
    1110 
    1111   lpstrSpecifiedByUser[0]='\0';
    11121205
    11131206  TRACE("\n");
    1114 
    1115   /* Check if there is a selected item in the listview */
    1116   if(fodInfos->DlgInfos.dwDlgProp & FODPROP_USEVIEW)
    1117   {
    1118       pidlSelection = GetSelectedPidl(fodInfos->Shell.FOIShellView);
    1119       GetName(fodInfos->Shell.FOIShellFolder,pidlSelection,SHGDN_NORMAL,lpstrSpecifiedByUser);
    1120       COMDLG32_SHFree((LPVOID)pidlSelection);
    1121   }
    1122   else
    1123       /* Get the text from the filename edit */
    1124       GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrSpecifiedByUser,MAX_PATH);
    1125 
    1126   if(strlen(lpstrSpecifiedByUser))
     1207//CB: optimize this function!
     1208  /* If a folder is selected browse folder */
     1209  if (BrowseSelectedFolder(hwnd))
     1210      return FALSE;
     1211
     1212  lpstrFile = fodInfos->ofnInfos->lpstrFile;
     1213
     1214  GetDlgItemTextA(hwnd, IDC_FILENAME, lpstrSpecifiedByUser, MAX_PATH);
     1215  nStrLen = strlen(lpstrSpecifiedByUser);
     1216
     1217  while ( nStrCharCount <= nStrLen )
     1218  {
     1219      if ( lpstrSpecifiedByUser[nStrCharCount]=='"' )
     1220      {
     1221          nStrCharCount++;
     1222
     1223          while ((lpstrSpecifiedByUser[nStrCharCount]!='"') &&
     1224              (nStrCharCount <= nStrLen))
     1225  {
     1226              lpstrFileList[nFileIndex++] = lpstrSpecifiedByUser[nStrCharCount];
     1227              nStrCharCount++;
     1228              sizeUsed++;
     1229  }
     1230          lpstrFileList[nFileIndex++] = '\0';
     1231          sizeUsed++;
     1232          nFileCount++;
     1233      }
     1234      nStrCharCount++;
     1235  }
     1236
     1237  if(nFileCount > 0)
     1238      return FILEDLG95_OnOpenMultipleFiles(hwnd, lpstrFileList, nFileCount, sizeUsed);
     1239
     1240  if (nStrLen)
    11271241  {
    11281242      LPSHELLFOLDER psfDesktop;
     
    11301244      LPSTR lpstrFileSpec;
    11311245      LPSTR lpstrTemp;
    1132       char lpstrPathSpec[MAX_PATH];
    1133       char lpstrCurrentDir[MAX_PATH];
    1134       char lpstrPathAndFile[MAX_PATH];
    1135 
    1136       lpstrPathSpec[0]    = '\0';
    1137       lpstrCurrentDir[0]  = '\0';
    1138       lpstrPathAndFile[0] = '\0';
     1246      char lpstrPathSpec[MAX_PATH] = "";
     1247      char lpstrCurrentDir[MAX_PATH] = "";
     1248      char lpstrPathAndFile[MAX_PATH] = "";
    11391249
    11401250      /* Separate the file spec from the path spec
     
    11431253              C:\TEXT1\TEXT2        C:\TEXT1          TEXT2
    11441254      */
     1255      if (nFileCount == 0)
     1256      {
    11451257      lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA(lpstrSpecifiedByUser);
    11461258      strcpy(lpstrPathSpec,lpstrSpecifiedByUser);
    11471259      COMDLG32_PathRemoveFileSpecA(lpstrPathSpec);
     1260      }
    11481261
    11491262      /* Get the index of the selected item in the filetype combo box */
    1150       fodInfos->ofnInfos.nFilterIndex = (DWORD) CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
     1263      fodInfos->ofnInfos->nFilterIndex = (DWORD) CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
    11511264      /* nFilterIndex is 1 based while combo GetCurSel return zero based index */
    1152       fodInfos->ofnInfos.nFilterIndex++;
     1265      fodInfos->ofnInfos->nFilterIndex++;
    11531266
    11541267      /* Get the current directory name */
     
    11641277          case '\\':
    11651278              {
    1166               int lenPathSpec=strlen(lpstrPathSpec);
    1167               INT iCopy = (lenPathSpec!=0?2:3);
    1168               memmove(lpstrPathSpec+iCopy,lpstrPathSpec,lenPathSpec);
    1169               strncpy(lpstrPathSpec,lpstrCurrentDir,iCopy);
     1279                  INT iCopy = 2;
     1280                  char lpstrTmp[MAX_PATH] = "";
     1281                  if(!strlen(lpstrPathSpec))
     1282                      iCopy = 3;
     1283                  strncpy(lpstrTmp,lpstrCurrentDir,iCopy);
     1284                  strcat(lpstrTmp,lpstrPathSpec);
     1285                  strcpy(lpstrPathSpec,lpstrTmp);
    11701286              }
    11711287              break;
     
    11741290              {
    11751291                  INT iSize;
    1176                   char lpstrTmp2[MAX_PATH];
     1292                  char lpstrTmp2[MAX_PATH] = "";
    11771293                  LPSTR lpstrTmp = strrchr(lpstrCurrentDir,'\\');
    1178 
    11791294                  iSize = lpstrTmp - lpstrCurrentDir;
    11801295                  strncpy(lpstrTmp2,lpstrCurrentDir,iSize + 1);
    11811296                  if(strlen(lpstrSpecifiedByUser) <= 3)
    1182                   *lpstrFileSpec='\0';
     1297                      strcpy(lpstrFileSpec,"");
    11831298                  if(strcmp(lpstrPathSpec,".."))
    11841299                      strcat(lpstrTmp2,&lpstrPathSpec[3]);
     
    11881303          default:
    11891304  {
    1190                   char lpstrTmp[MAX_PATH];
    1191 
     1305                  char lpstrTmp[MAX_PATH] = "";
    11921306                  if(strcmp(&lpstrCurrentDir[strlen(lpstrCurrentDir)-1],"\\"))
    11931307                      strcat(lpstrCurrentDir,"\\");
     
    12161330          {
    12171331              /* Path does not exist */
    1218               if(fodInfos->ofnInfos.Flags & OFN_PATHMUSTEXIST)
     1332              if(fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST)
    12191333              {
    12201334                  MessageBoxA(hwnd,
    12211335                              "Path does not exist",
    1222                               fodInfos->ofnInfos.lpstrTitle,
     1336                              fodInfos->ofnInfos->lpstrTitle,
    12231337                              MB_OK | MB_ICONEXCLAMATION);
    12241338                  return FALSE;
     
    12731387    }
    12741388
     1389      {
     1390       HANDLE hFile;
     1391       WIN32_FIND_DATAA stffile;
    12751392      /* browse if the user specified a directory */
     1393       hFile = FindFirstFileA(lpstrFileSpec, &stffile);
     1394       if ( hFile != INVALID_HANDLE_VALUE )
     1395       {
     1396        FindClose (hFile);
     1397        if (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
    12761398      browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder,
    12771399              lpstrFileSpec);
     1400        else
     1401        {
     1402         // if there is an extention, then get the Pidl otherwise
     1403         // we are going to need to add the extention
     1404         if(strrchr(lpstrFileSpec,'.'))
     1405          browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder,
     1406                lpstrFileSpec);
     1407         else
     1408          browsePidl=NULL;
     1409        }
     1410       }
     1411       else
     1412        browsePidl=NULL;
     1413      }
     1414
    12781415      if (!browsePidl) /* not a directory check the specified file exists */
    12791416      {
     1417       int i;
    12801418          int iExt;
    12811419          char lpstrFileSpecTemp[MAX_PATH] = "";
     
    12851423          iExt = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
    12861424          lpOrg = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, iExt);
     1425          if (lpOrg == (LPSTR)-1)
     1426              lpOrg = NULL;     // we get -1 if the filetype LB is empty
     1427
    12871428          lpstrExt = lpOrg;
    12881429
    12891430          /*
    1290              add user specified extentions to the file one by one and
    1291              check if the file exists
     1431          Simply take the first one of the list as default.
     1432          Otherwise the user must specify which extention they want.
     1433          Also, make sure we don't have a .*, in this case simply
     1434          forget about the extention
    12921435         */
    1293           while(lpOrg)
    1294          {
    1295              int i;
    12961436             lpstrExt = strchr(lpOrg, ';');
    12971437             if (lpstrExt)
     
    13091449                 if (strchr(lpBuf, '.'))
    13101450                     strcat(lpstrFileSpecTemp, (strchr(lpBuf, '.')) + 1);
    1311              } else {
    1312                  if (strchr(lpBuf, '.'))
    1313                      strcat(lpstrFileSpecTemp, strchr(lpBuf, '.'));
    13141451             }
     1452             else
     1453                 strcat(lpstrFileSpecTemp, strchr(lpBuf, '.'));
    13151454             browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder,
    13161455                     lpstrFileSpecTemp);
    13171456             MemFree((void *)lpBuf);
    13181457             if (browsePidl)
    1319              {
    13201458                 strcpy(lpstrFileSpec,lpstrFileSpecTemp);
    1321                  break;
    1322              }
    13231459             if (lpstrExt)
    13241460                 lpOrg = lpstrExt+1;
    13251461             else
    13261462                 lpOrg = NULL;
    1327          }
    13281463      }
    13291464
     
    13461481                                                   SBSP_RELATIVE)))
    13471482        {
    1348                   if(fodInfos->ofnInfos.Flags & OFN_PATHMUSTEXIST)
     1483                  if(fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST)
    13491484        {
    13501485                      MessageBoxA(hwnd,
    13511486                                  "Path does not exist",
    1352                                   fodInfos->ofnInfos.lpstrTitle,
     1487                                  fodInfos->ofnInfos->lpstrTitle,
    13531488                                  MB_OK | MB_ICONEXCLAMATION);
    13541489                      COMDLG32_SHFree(browsePidl);
     
    13621497          /* The file does exist, so ask the user if we should overwrite it */
    13631498          if((fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) &&
    1364              (fodInfos->ofnInfos.Flags & OFN_OVERWRITEPROMPT))
     1499             (fodInfos->ofnInfos->Flags & OFN_OVERWRITEPROMPT))
    13651500          {
    13661501                strcpy(lpstrFileExist, lpstrFileSpec);
     
    13691504                nMsgBoxRet = MessageBoxA(hwnd,
    13701505                                        lpstrFileExist,
    1371                                         fodInfos->ofnInfos.lpstrTitle,
     1506                                        fodInfos->ofnInfos->lpstrTitle,
    13721507                                        MB_YESNO | MB_ICONEXCLAMATION);
    13731508                if (nMsgBoxRet == IDNO)
     
    13851520          /* The selected file does not exist */
    13861521      /* Tell the user the selected does not exist */
    1387       if(fodInfos->ofnInfos.Flags & OFN_FILEMUSTEXIST)
     1522      if(fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST)
    13881523      {
    13891524        char lpstrNotFound[100];
     
    14001535                          100);
    14011536
    1402         strcpy(tmp,fodInfos->ofnInfos.lpstrFile);
     1537        strcpy(tmp,fodInfos->ofnInfos->lpstrFile);
    14031538        strcat(tmp,"\n");
    14041539        strcat(tmp,lpstrNotFound);
     
    14081543              MessageBoxA(hwnd,
    14091544                          tmp,
    1410                           fodInfos->ofnInfos.lpstrTitle,
     1545                          fodInfos->ofnInfos->lpstrTitle,
    14111546                          MB_OK | MB_ICONEXCLAMATION);
    14121547        return FALSE;
    14131548      }
    14141549      /* Ask the user if he wants to create the file*/
    1415       if(fodInfos->ofnInfos.Flags & OFN_CREATEPROMPT)
     1550      if(fodInfos->ofnInfos->Flags & OFN_CREATEPROMPT)
    14161551      {
    14171552        char tmp[100];
     
    14191554        LoadStringA(COMMDLG_hInstance32,IDS_CREATEFILE,tmp,100);
    14201555
    1421               if(IDYES == MessageBoxA(hwnd,tmp,fodInfos->ofnInfos.lpstrTitle,
     1556              if(IDYES == MessageBoxA(hwnd,tmp,fodInfos->ofnInfos->lpstrTitle,
    14221557                                      MB_YESNO | MB_ICONQUESTION))
    14231558        {
    14241559            /* Create the file, clean and exit */
    1425             FILEDLG95_Clean(hwnd);
    14261560            return EndDialog(hwnd,TRUE);
    14271561        }
     
    14291563      }
    14301564    }
     1565      /* check the write access to the current directory before opening the selected file */
     1566      if((fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && (fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST))
     1567      {
     1568          HANDLE hfile;
     1569          char testFile[MAX_PATH];
     1570
     1571          strcpy(testFile,lpstrPathSpec);
     1572          strcat(testFile,"_tes_13.579");
     1573
     1574          hfile = CreateFileA(testFile,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0);
     1575
     1576          switch(GetLastError())
     1577          {
     1578          case ERROR_ACCESS_DENIED:
     1579          case ERROR_WRITE_PROTECT:
     1580          case ERROR_PATH_NOT_FOUND:
     1581          case ERROR_FILE_NOT_FOUND:
     1582              {
     1583                  char strAccessDenied[MAX_PATH + 100];
     1584                  strcpy(strAccessDenied,lpstrPathSpec);
     1585                  strcat(strAccessDenied,lpstrFileSpec);
     1586                  strcat(strAccessDenied,"\nWrite access denied for this file !");
     1587                  MessageBoxA(hwnd,strAccessDenied,fodInfos->ofnInfos->lpstrTitle,MB_OK | MB_ICONEXCLAMATION);
     1588                  return FALSE;
     1589              }
     1590          }
     1591
     1592          if (hfile != INVALID_HANDLE_VALUE)
     1593          {
     1594              CloseHandle(hfile);
     1595              DeleteFileA(testFile);
     1596          }
     1597
     1598      }
    14311599
    14321600      /* Open the selected file */
     
    14571625              }
    14581626
    1459               if(!strcmp(&lpstrExt[1],"*") && fodInfos->ofnInfos.lpstrDefExt)
    1460               {
    1461                   lpstrExt = MemAlloc(strlen(fodInfos->ofnInfos.lpstrDefExt)+2);
    1462                   strcat(lpstrExt,".");
    1463                   strcat(lpstrExt,(LPSTR) fodInfos->ofnInfos.lpstrDefExt);
     1627               if(strcmp(lpstrExt,".*") != 0)
     1628               {
     1629                  /* OPEN DIALOG: Let's see if the file exists with the current extention,
     1630                     if not return the file without the extention.
     1631                     SAVE DIALOG: Concatenate the extention to the file.
     1632                  */
     1633
     1634                  if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG))
     1635                  {
     1636                        LPSTR lpstrFindFile;
     1637                        WIN32_FIND_DATAA fd;
     1638
     1639                        lpstrFindFile = MemAlloc(strlen(lpstrPathAndFile)+strlen(lpstrExt));
     1640                        strcpy(lpstrFindFile, lpstrPathAndFile);
     1641                        strcat(lpstrFindFile, lpstrExt);
     1642                        if(FindFirstFileA(lpstrFindFile, &fd) != INVALID_HANDLE_VALUE)
     1643                                strcat(lpstrPathAndFile,lpstrExt);
     1644                        MemFree(lpstrFindFile);
     1645                  }
     1646                  else
     1647                        strcat(lpstrPathAndFile,lpstrExt);
    14641648              }
    1465               strcat(lpstrPathAndFile,lpstrExt);
     1649              MemFree( lpstrExt );
    14661650          }
    14671651      }
    14681652      /* Check that size size of the file does not exceed buffer size */
    1469       if(strlen(lpstrPathAndFile) > fodInfos->ofnInfos.nMaxFile)
     1653      if(strlen(lpstrPathAndFile) > fodInfos->ofnInfos->nMaxFile)
    14701654      {
    14711655          /* set error FNERR_BUFFERTOSMALL */
    1472           FILEDLG95_Clean(hwnd);
    14731656          return EndDialog(hwnd,FALSE);
    14741657      }
    1475       strcpy(fodInfos->ofnInfos.lpstrFile,lpstrPathAndFile);
     1658      strcpy(fodInfos->ofnInfos->lpstrFile,lpstrPathAndFile);
     1659         fodInfos->ofnInfos->lpstrFile[strlen(lpstrPathAndFile)] = '\0';
     1660         fodInfos->ofnInfos->lpstrFile[strlen(lpstrPathAndFile)+1] = '\0';
    14761661
    14771662      /* Set the lpstrFileTitle of the OPENFILENAME structure */
    1478       if(fodInfos->ofnInfos.lpstrFileTitle)
    1479           strncpy(fodInfos->ofnInfos.lpstrFileTitle,
     1663      if(fodInfos->ofnInfos->lpstrFileTitle)
     1664          strncpy(fodInfos->ofnInfos->lpstrFileTitle,
    14801665                  lpstrFileSpec,
    1481                   fodInfos->ofnInfos.nMaxFileTitle);
     1666                  fodInfos->ofnInfos->nMaxFileTitle);
    14821667
    14831668      /* Check if the file is to be opened as read only */
     
    14851670                                            IDC_OPENREADONLY,
    14861671                                            BM_GETSTATE,0,0))
    1487           SetFileAttributesA(fodInfos->ofnInfos.lpstrFile,
     1672          SetFileAttributesA(fodInfos->ofnInfos->lpstrFile,
    14881673                             FILE_ATTRIBUTE_READONLY);
    14891674
    14901675      /*  nFileExtension and nFileOffset of OPENFILENAME structure */
    1491       lpstrTemp = strrchr(fodInfos->ofnInfos.lpstrFile,'\\');
    1492       fodInfos->ofnInfos.nFileOffset = lpstrTemp - fodInfos->ofnInfos.lpstrFile + 1;
    1493       lpstrTemp = strrchr(fodInfos->ofnInfos.lpstrFile,'.');
    1494       fodInfos->ofnInfos.nFileExtension = lpstrTemp - fodInfos->ofnInfos.lpstrFile + 1;
     1676      lpstrTemp = strrchr(fodInfos->ofnInfos->lpstrFile,'\\');
     1677      fodInfos->ofnInfos->nFileOffset = lpstrTemp - fodInfos->ofnInfos->lpstrFile + 1;
     1678      lpstrTemp = strrchr(fodInfos->ofnInfos->lpstrFile,'.');
     1679      fodInfos->ofnInfos->nFileExtension = lpstrTemp - fodInfos->ofnInfos->lpstrFile + 1;
    14951680
    14961681
    14971682    /* clean and exit */
    1498     FILEDLG95_Clean(hwnd);
    14991683    return EndDialog(hwnd,TRUE);
    15001684  }
     
    15271711  fodInfos->ShellInfos.hwndOwner = hwnd;
    15281712
    1529   fodInfos->ShellInfos.folderSettings.fFlags = FWF_AUTOARRANGE | FWF_ALIGNLEFT;
     1713  fodInfos->ShellInfos.folderSettings.fFlags = 0;
     1714  /* Disable multi-select if flag not set */
     1715  if (!(fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT))
     1716  {
     1717     fodInfos->ShellInfos.folderSettings.fFlags |= FWF_SINGLESEL;
     1718  }
     1719  fodInfos->ShellInfos.folderSettings.fFlags |= FWF_AUTOARRANGE | FWF_ALIGNLEFT;
    15301720  fodInfos->ShellInfos.folderSettings.ViewMode = FVM_LIST;
    15311721
     
    16541844      char lpstrText[128+MAX_PATH];
    16551845      char lpstrTempText[128];
    1656       char lpstrCaption[256];
     1846      char lpstrCaption[32];
    16571847
    16581848      /* Cannot Create folder because of permissions */
     
    16951885  TRACE("\n");
    16961886
    1697   if(fodInfos->ofnInfos.lpstrFilter)
     1887  if(fodInfos->ofnInfos->lpstrFilter)
    16981888  {
    16991889    int iStrIndex = 0;
     
    17121902
    17131903      /* Get the title */
    1714       lpstrTmp = (&((LPBYTE)fodInfos->ofnInfos.lpstrFilter)[iStrIndex]);
     1904      lpstrTmp = (&((LPBYTE)fodInfos->ofnInfos->lpstrFilter)[iStrIndex]);
    17151905      if(!strlen(lpstrTmp))
    17161906        break;
    17171907      iStrIndex += strlen(lpstrTmp) +1;
    17181908      /* Get the extension */
    1719       lpstrExtTmp = (&((LPBYTE)fodInfos->ofnInfos.lpstrFilter)[iStrIndex]);
     1909      lpstrExtTmp = (&((LPBYTE)fodInfos->ofnInfos->lpstrFilter)[iStrIndex]);
    17201910      if(!lpstrExtTmp)
    17211911          break;
     
    17381928
    17391929      /* set default filter index */
    1740       if(fodInfos->ofnInfos.nFilterIndex == 0 && fodInfos->ofnInfos.lpstrCustomFilter == NULL)
    1741         fodInfos->ofnInfos.nFilterIndex = 1;
     1930      if(fodInfos->ofnInfos->nFilterIndex == 0 && fodInfos->ofnInfos->lpstrCustomFilter == NULL)
     1931        fodInfos->ofnInfos->nFilterIndex = 1;
    17421932      /* First, check to make sure our index isn't out of bounds. */
    1743       if ( fodInfos->ofnInfos.nFilterIndex > iPos )
    1744         fodInfos->ofnInfos.nFilterIndex = iPos;
     1933      if ( fodInfos->ofnInfos->nFilterIndex > iPos )
     1934        fodInfos->ofnInfos->nFilterIndex = iPos;
    17451935
    17461936
    17471937      /* Get the current index selection. */
    17481938      CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB,
    1749                   fodInfos->ofnInfos.nFilterIndex-1);
     1939                  fodInfos->ofnInfos->nFilterIndex-1);
    17501940
    17511941      /* Get the corresponding text string from the combo box. */
    17521942      lpstrFilter = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,
    1753                                              fodInfos->ofnInfos.nFilterIndex-1);
     1943                                             fodInfos->ofnInfos->nFilterIndex-1);
     1944
     1945      if ((INT)lpstrFilter == -1)
     1946        lpstrFilter = NULL;     // we get -1 if the control is empty
    17541947
    17551948    if(lpstrFilter)
     
    17741967  switch(wNotifyCode)
    17751968  {
    1776     case CBN_CLOSEUP:
     1969    case CBN_SELENDOK:
    17771970    {
    17781971      LPSTR lpstrFilter;
     
    17801973      /* Get the current item of the filetype combo box */
    17811974      int iItem = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
     1975
     1976      /* set the current filter index - indexed from 1 */
     1977      fodInfos->ofnInfos->nFilterIndex = iItem + 1;
    17821978
    17831979      /* Set the current filter with the current selection */
     
    18702066  CBSetItemHeight(hwndCombo,0,GetSystemMetrics(SM_CYSMICON));
    18712067
     2068#ifndef SHELL_NO_DESKTOP
    18722069  /* Initialise data of Desktop folder */
    18732070  COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
    18742071  FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND);
    18752072  COMDLG32_SHFree(pidlTmp);
     2073#endif
    18762074
    18772075  COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DRIVES,&pidlDrives);
     
    19342132  int iIndentation;
    19352133  LPSFOLDER tmpFolder;
     2134  INT iIcon;
    19362135
    19372136  LookInInfos *liInfos = (LookInInfos *)GetPropA(pDIStruct->hwndItem,LookInInfosStr);
     
    19422141    return 0;
    19432142
    1944   if(!(tmpFolder = (LPSFOLDER) CBGetItemDataPtr(pDIStruct->hwndItem,
     2143  if((LPSFOLDER)CB_ERR == (tmpFolder = (LPSFOLDER) CBGetItemDataPtr(pDIStruct->hwndItem,
    19452144                            pDIStruct->itemID)))
    19462145    return 0;
     
    19572156                                                  &sfi,
    19582157                                                  sizeof (SHFILEINFOA),
    1959                                                   SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME);
     2158                                                  SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME);
    19602159    len = strlen(sfi.szDisplayName)+1;
    19612160    tmpFolder->szDisplayName = MemAlloc(len);
     
    19632162    tmpFolder->iIcon = sfi.iIcon;
    19642163  }
     2164
     2165  if((pDIStruct->itemID == liInfos->uSelectedItem) || (pDIStruct->itemState & ODS_COMBOBOXEDIT))
     2166  {
     2167    if (!tmpFolder->iSelIcon)
     2168    {
     2169      SHFILEINFOA sfi2;
     2170
     2171      COMDLG32_SHGetFileInfoA((LPCSTR)tmpFolder->pidlItem,0,&sfi2,sizeof(SHFILEINFOA),
     2172                              SHGFI_PIDL | SHGFI_SMALLICON |
     2173                              SHGFI_OPENICON | SHGFI_SYSICONINDEX);
     2174      tmpFolder->iSelIcon = sfi2.iIcon;
     2175    }
     2176    iIcon = tmpFolder->iSelIcon;
     2177  } else iIcon = tmpFolder->iIcon;
     2178
    19652179
    19662180  /* Is this item selected ?*/
     
    20012215  /* Draw the icon from the image list */
    20022216  COMDLG32_ImageList_Draw(tmpFolder->ilItemImage,
    2003                  tmpFolder->iIcon,
     2217                 iIcon,
    20042218                 pDIStruct->hDC,
    20052219                 rectIcon.left,
     
    20292243  switch(wNotifyCode)
    20302244  {
    2031   case CBN_CLOSEUP:
     2245  case CBN_SELENDOK:
    20322246    {
    20332247      LPSFOLDER tmpFolder;
     
    20642278  LPITEMIDLIST pidlNext;
    20652279  SHFILEINFOA sfi;
    2066   SFOLDER *tmpFolder = MemAlloc(sizeof(SFOLDER));
     2280  SFOLDER *tmpFolder;
    20672281  LookInInfos *liInfos;
    20682282
    20692283  TRACE("\n");
     2284
     2285  if(!pidl)
     2286    return -1;
    20702287
    20712288  if(!(liInfos = (LookInInfos *)GetPropA(hwnd,LookInInfosStr)))
    20722289    return -1;
    20732290
     2291  tmpFolder = MemAlloc(sizeof(SFOLDER));
    20742292  tmpFolder->m_iIndent = 0;
    20752293  tmpFolder->szDisplayName = NULL;
    2076 
    2077   if(!pidl)
    2078     return -1;
    20792294
    20802295  /* Calculate the indentation of the item in the lookin*/
     
    20942309                  &sfi,
    20952310                  sizeof(sfi),
    2096                   SHGFI_ATTRIBUTES);
     2311                  SHGFI_PIDL | SHGFI_ATTRIBUTES);
    20972312
    20982313  if((sfi.dwAttributes & SFGAO_FILESYSANCESTOR) || (sfi.dwAttributes & SFGAO_FILESYSTEM))
     
    21152330  }
    21162331
     2332  MemFree(tmpFolder);
    21172333  return -1;
    2118 
    21192334}
    21202335
     
    24332648    }
    24342649}
     2650
     2651/***********************************************************************
     2652 *      BrowseSelectedFolder
     2653 *
     2654 */
     2655static BOOL BrowseSelectedFolder(HWND hwnd)
     2656{
     2657  BOOL bBrowseSelFolder = FALSE;
     2658
     2659  FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
     2660
     2661  if (GetNumSelected(fodInfos->Shell.FOIShellView) == 1)
     2662  {
     2663      LPITEMIDLIST pidlSelection;
     2664      ULONG uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
     2665
     2666      /* get the file selected */
     2667      EnumSelectedPidls( fodInfos->Shell.FOIShellView, 0, &pidlSelection );
     2668      IShellFolder_GetAttributesOf( fodInfos->Shell.FOIShellFolder, 1, &pidlSelection, &uAttr );
     2669      if ( uAttr & SFGAO_FOLDER )
     2670      {
     2671          if ( FAILED( IShellBrowser_BrowseObject( fodInfos->Shell.FOIShellBrowser,
     2672                          pidlSelection, SBSP_RELATIVE ) ) )
     2673          {
     2674               MessageBoxA( hwnd, "Path does not exist", fodInfos->ofnInfos->lpstrTitle,
     2675                       MB_OK | MB_ICONEXCLAMATION );
     2676          }
     2677
     2678          bBrowseSelFolder = TRUE;
     2679      }
     2680      COMDLG32_SHFree( pidlSelection );
     2681  }
     2682
     2683  return bBrowseSelFolder;
     2684}
     2685
Note: See TracChangeset for help on using the changeset viewer.