Changeset 3202 for trunk/src


Ignore:
Timestamp:
Mar 23, 2000, 6:13:41 PM (25 years ago)
Author:
cbratschi
Message:

faster file dialog combobox

File:
1 edited

Legend:

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

    r2607 r3202  
    1111#include <misc.h>
    1212
    13 #define MapHModuleSL(a) a
     13#define MapHModuleSL(a) a
    1414#define MapHModuleLS(a) a
    1515
     
    2929#include "debugtools.h"
    3030#include "cderr.h"
    31 #include "tweak.h"
    3231#include "winnls.h"
    3332#include "shellapi.h"
     
    4342typedef struct SFolder
    4443{
    45   int m_iImageIndex;    /* Index of picture in image list */
    46   HIMAGELIST hImgList;
    47   int m_iIndent;      /* Indentation index */
    48   LPITEMIDLIST pidlItem;  /* absolute pidl of the item */
     44  int          m_iImageIndex;    /* Index of picture in image list */
     45  HIMAGELIST   hImgList;
     46  int          m_iIndent;      /* Indentation index */
     47  LPITEMIDLIST pidlItem;  /* absolute pidl of the item */
     48  CHAR*        szDisplayName;
     49  INT          iIcon;
     50  HIMAGELIST   ilItemImage;
    4951
    5052} SFOLDER,*LPSFOLDER;
     
    175177 *      GetFileName95
    176178 *
    177  * Creates an Open common dialog box that lets the user select 
     179 * Creates an Open common dialog box that lets the user select
    178180 * the drive, directory, and the name of a file or set of files to open.
    179181 *
     
    212214    if( lRes == -1)
    213215        return FALSE;
    214    
     216
    215217    return lRes;
    216218}
     
    230232  BOOL ret;
    231233  FileOpenDlgInfos *fodInfos;
    232  
    233   /* Initialise FileOpenDlgInfos structure*/ 
     234
     235  /* Initialise FileOpenDlgInfos structure*/
    234236  fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos));
    235237  memset(&fodInfos->ofnInfos,'\0',sizeof(*ofn)); fodInfos->ofnInfos.lStructSize = sizeof(*ofn);
     
    317319  fodInfos->DlgInfos.dwDlgProp = 0;
    318320  fodInfos->DlgInfos.hwndCustomDlg = (HWND)NULL;
    319  
     321
    320322  switch(iDlgType)
    321323  {
     
    353355      MemFree((LPVOID)(fodInfos->ofnInfos.lpstrCustomFilter));
    354356
    355   if (fodInfos->ofnInfos.lpstrFile) 
     357  if (fodInfos->ofnInfos.lpstrFile)
    356358  {
    357359      /*
     
    364366      MemFree((LPVOID)fodInfos->ofnInfos.lpstrFile);
    365367  }
    366   if (fodInfos->ofnInfos.lpstrFileTitle) 
     368  if (fodInfos->ofnInfos.lpstrFileTitle)
    367369    {
    368370      if (ofn->lpstrFileTitle)
     
    404406    /* filter is a list...  title\0ext\0......\0\0 */
    405407    s = (LPWSTR)ofn->lpstrFilter;
    406    
     408
    407409    while (*s)
    408410      s = s+lstrlenW(s)+1;
     
    470472
    471473  if (HIWORD(ofn->lpTemplateName))
    472   { 
     474  {
    473475    fodInfos->ofnInfos.lpTemplateName = (LPSTR)MemAlloc(lstrlenW(ofn->lpTemplateName)+1);
    474476    lstrcpyWtoA((LPSTR)fodInfos->ofnInfos.lpTemplateName,ofn->lpTemplateName);
     
    481483  /* Initialise the dialog property */
    482484  fodInfos->DlgInfos.dwDlgProp = 0;
    483  
     485
    484486  switch(iDlgType)
    485487  {
     
    494496      ret = 0;
    495497  }
    496      
     498
    497499  /* Cleaning */
    498500  ofn->nFileOffset = fodInfos->ofnInfos.nFileOffset;
     
    518520    MemFree((LPVOID)(fodInfos->ofnInfos.lpstrCustomFilter));
    519521
    520   if (fodInfos->ofnInfos.lpstrFile) 
     522  if (fodInfos->ofnInfos.lpstrFile)
    521523  {
    522524      /*
     
    544546{
    545547
    546         HWND hwndChild,hwndStc32;
    547         RECT rectParent, rectChild, rectCtrl, rectStc32, rectTemp;
    548         POINT ptMoveCtl;
    549         POINT ptParentClient;
    550 
    551         ptMoveCtl.x = ptMoveCtl.y = 0;
    552         hwndStc32=GetDlgItem(hwndChildDlg,stc32);
    553         GetClientRect(hwndParentDlg,&rectParent);
    554         GetClientRect(hwndChildDlg,&rectChild);
    555         if(hwndStc32)
    556         {
    557                 GetWindowRect(hwndStc32,&rectStc32);
    558                 MapWindowPoints(0, hwndChildDlg,(LPPOINT)&rectStc32,2);
    559                 CopyRect(&rectTemp,&rectStc32);
    560 
    561                 SetRect(&rectStc32,rectStc32.left,rectStc32.top,rectStc32.left + (rectParent.right-rectParent.left),rectStc32.top+(rectParent.bottom-rectParent.top));
    562                 SetWindowPos(hwndStc32,0,rectStc32.left,rectStc32.top,rectStc32.right-rectStc32.left,rectStc32.bottom-rectStc32.top,SWP_NOMOVE|SWP_NOZORDER | SWP_NOACTIVATE);
    563 
    564                 if(rectStc32.right < rectTemp.right)
    565                 {
    566                         ptParentClient.x = max((rectParent.right-rectParent.left),(rectChild.right-rectChild.left));
    567                         ptMoveCtl.x = 0;
    568                 }
    569                 else
    570                 {
    571                         ptMoveCtl.x = (rectStc32.right - rectTemp.right);
    572                         ptParentClient.x = max((rectParent.right-rectParent.left),((rectChild.right-rectChild.left)+rectStc32.right-rectTemp.right));
    573                 }
    574                 if(rectStc32.bottom < rectTemp.bottom)
    575                 {
    576                         ptParentClient.y = max((rectParent.bottom-rectParent.top),(rectChild.bottom-rectChild.top));
    577                         ptMoveCtl.y = 0;
    578                 }
    579                 else
    580                 {
    581                         ptMoveCtl.y = (rectStc32.bottom - rectTemp.bottom);
    582                         ptParentClient.y = max((rectParent.bottom-rectParent.top),((rectChild.bottom-rectChild.top)+rectStc32.bottom-rectTemp.bottom));
    583                 }
    584         }
    585         else
    586         {
    587                 if( (GetWindow(hwndChildDlg,GW_CHILD)) == (HWND) NULL)
     548        HWND hwndChild,hwndStc32;
     549        RECT rectParent, rectChild, rectCtrl, rectStc32, rectTemp;
     550        POINT ptMoveCtl;
     551        POINT ptParentClient;
     552
     553        ptMoveCtl.x = ptMoveCtl.y = 0;
     554        hwndStc32=GetDlgItem(hwndChildDlg,stc32);
     555        GetClientRect(hwndParentDlg,&rectParent);
     556        GetClientRect(hwndChildDlg,&rectChild);
     557        if(hwndStc32)
     558        {
     559                GetWindowRect(hwndStc32,&rectStc32);
     560                MapWindowPoints(0, hwndChildDlg,(LPPOINT)&rectStc32,2);
     561                CopyRect(&rectTemp,&rectStc32);
     562
     563                SetRect(&rectStc32,rectStc32.left,rectStc32.top,rectStc32.left + (rectParent.right-rectParent.left),rectStc32.top+(rectParent.bottom-rectParent.top));
     564                SetWindowPos(hwndStc32,0,rectStc32.left,rectStc32.top,rectStc32.right-rectStc32.left,rectStc32.bottom-rectStc32.top,SWP_NOMOVE|SWP_NOZORDER | SWP_NOACTIVATE);
     565
     566                if(rectStc32.right < rectTemp.right)
     567                {
     568                        ptParentClient.x = max((rectParent.right-rectParent.left),(rectChild.right-rectChild.left));
     569                        ptMoveCtl.x = 0;
     570                }
     571                else
     572                {
     573                        ptMoveCtl.x = (rectStc32.right - rectTemp.right);
     574                        ptParentClient.x = max((rectParent.right-rectParent.left),((rectChild.right-rectChild.left)+rectStc32.right-rectTemp.right));
     575                }
     576                if(rectStc32.bottom < rectTemp.bottom)
     577                {
     578                        ptParentClient.y = max((rectParent.bottom-rectParent.top),(rectChild.bottom-rectChild.top));
     579                        ptMoveCtl.y = 0;
     580                }
     581                else
     582                {
     583                        ptMoveCtl.y = (rectStc32.bottom - rectTemp.bottom);
     584                        ptParentClient.y = max((rectParent.bottom-rectParent.top),((rectChild.bottom-rectChild.top)+rectStc32.bottom-rectTemp.bottom));
     585                }
     586        }
     587        else
     588        {
     589                if( (GetWindow(hwndChildDlg,GW_CHILD)) == (HWND) NULL)
    588590                   return;
    589                 ptParentClient.x = rectParent.right-rectParent.left;
    590                 ptParentClient.y = (rectParent.bottom-rectParent.top) + (rectChild.bottom-rectChild.top);
    591                 ptMoveCtl.y = rectParent.bottom-rectParent.top;
    592                 ptMoveCtl.x=0;
    593         }
    594         SetRect(&rectParent,rectParent.left,rectParent.top,rectParent.left+ptParentClient.x,rectParent.top+ptParentClient.y);
    595         AdjustWindowRectEx( &rectParent,GetWindowLongA(hwndParentDlg,GWL_STYLE),FALSE,GetWindowLongA(hwndParentDlg,GWL_EXSTYLE));
    596 
    597         SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x,ptParentClient.y,
    598                 SWP_NOZORDER );
    599         SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left),
    600                 (rectParent.bottom-rectParent.top),SWP_NOMOVE | SWP_NOZORDER);
    601        
    602         hwndChild = GetWindow(hwndChildDlg,GW_CHILD);
    603         if(hwndStc32)
    604         {
    605                 GetWindowRect(hwndStc32,&rectStc32);
    606                 MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2);
    607         }
    608         else
    609                 SetRect(&rectStc32,0,0,0,0);
    610 
    611         if (hwndChild )
    612         {
    613                 do
    614                 {
    615                         if(hwndChild != hwndStc32)
    616                         {
    617                         if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE)
    618                                 continue;
    619                         GetWindowRect(hwndChild,&rectCtrl);
    620                         MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2);
    621                                  
    622                                 /*
    623                                    Check the initial position of the controls relative to the initial
    624                                    position and size of stc32 (before it is expanded).
    625                                 */
     591                ptParentClient.x = rectParent.right-rectParent.left;
     592                ptParentClient.y = (rectParent.bottom-rectParent.top) + (rectChild.bottom-rectChild.top);
     593                ptMoveCtl.y = rectParent.bottom-rectParent.top;
     594                ptMoveCtl.x=0;
     595        }
     596        SetRect(&rectParent,rectParent.left,rectParent.top,rectParent.left+ptParentClient.x,rectParent.top+ptParentClient.y);
     597        AdjustWindowRectEx( &rectParent,GetWindowLongA(hwndParentDlg,GWL_STYLE),FALSE,GetWindowLongA(hwndParentDlg,GWL_EXSTYLE));
     598
     599        SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x,ptParentClient.y,
     600                SWP_NOZORDER );
     601        SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left),
     602                (rectParent.bottom-rectParent.top),SWP_NOMOVE | SWP_NOZORDER);
     603
     604        hwndChild = GetWindow(hwndChildDlg,GW_CHILD);
     605        if(hwndStc32)
     606        {
     607                GetWindowRect(hwndStc32,&rectStc32);
     608                MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2);
     609        }
     610        else
     611                SetRect(&rectStc32,0,0,0,0);
     612
     613        if (hwndChild )
     614        {
     615                do
     616                {
     617                        if(hwndChild != hwndStc32)
     618                        {
     619                        if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE)
     620                                continue;
     621                        GetWindowRect(hwndChild,&rectCtrl);
     622                        MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2);
     623
     624                                /*
     625                                   Check the initial position of the controls relative to the initial
     626                                   position and size of stc32 (before it is expanded).
     627                                */
    626628                if (rectCtrl.left > rectTemp.right && rectCtrl.top > rectTemp.bottom)
    627                                 {
    628                                         rectCtrl.left += ptMoveCtl.x;
    629                                 rectCtrl.top  += ptMoveCtl.y;
    630                                 }
    631                                 else if (rectCtrl.left > rectTemp.right)
    632                                         rectCtrl.left += ptMoveCtl.x;
    633                                 else if (rectCtrl.top > rectTemp.bottom)
    634                                         rectCtrl.top  += ptMoveCtl.y;
    635                                        
    636                                 SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
    637                                 rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top,
    638                                 SWP_NOSIZE | SWP_NOZORDER );
    639                                 }
    640                         }
    641                 while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL);
    642         }               
    643         hwndChild = GetWindow(hwndParentDlg,GW_CHILD);
    644        
    645         if(hwndStc32)
    646         {
    647                 GetWindowRect(hwndStc32,&rectStc32);
    648                 MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2);
    649                 ptMoveCtl.x = rectStc32.left - 0;
    650                 ptMoveCtl.y = rectStc32.top - 0;
    651                 if (hwndChild )
    652                 {
    653                         do
    654                         {
    655                                 if(hwndChild != hwndChildDlg)
    656                                 {
    657 
    658                                         if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE)
    659                                                 continue;
    660                                         GetWindowRect(hwndChild,&rectCtrl);
    661                                         MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2);
    662 
    663                                         rectCtrl.left += ptMoveCtl.x;
    664                                         rectCtrl.top += ptMoveCtl.y;
    665 
    666                                         SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
    667                                         rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top,
    668                                         SWP_NOSIZE |SWP_NOZORDER );
    669                                 }
    670                         }
    671                         while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL);
    672                 }               
    673         }
     629                                {
     630                                        rectCtrl.left += ptMoveCtl.x;
     631                                rectCtrl.top  += ptMoveCtl.y;
     632                                }
     633                                else if (rectCtrl.left > rectTemp.right)
     634                                        rectCtrl.left += ptMoveCtl.x;
     635                                else if (rectCtrl.top > rectTemp.bottom)
     636                                        rectCtrl.top  += ptMoveCtl.y;
     637
     638                                SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
     639                                rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top,
     640                                SWP_NOSIZE | SWP_NOZORDER );
     641                                }
     642                        }
     643                while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL);
     644        }
     645        hwndChild = GetWindow(hwndParentDlg,GW_CHILD);
     646
     647        if(hwndStc32)
     648        {
     649                GetWindowRect(hwndStc32,&rectStc32);
     650                MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2);
     651                ptMoveCtl.x = rectStc32.left - 0;
     652                ptMoveCtl.y = rectStc32.top - 0;
     653                if (hwndChild )
     654                {
     655                        do
     656                        {
     657                                if(hwndChild != hwndChildDlg)
     658                                {
     659
     660                                        if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE)
     661                                                continue;
     662                                        GetWindowRect(hwndChild,&rectCtrl);
     663                                        MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2);
     664
     665                                        rectCtrl.left += ptMoveCtl.x;
     666                                        rectCtrl.top += ptMoveCtl.y;
     667
     668                                        SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top,
     669                                        rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top,
     670                                        SWP_NOSIZE |SWP_NOZORDER );
     671                                }
     672                        }
     673                        while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL);
     674                }
     675        }
    674676
    675677}
     
    681683  switch(uMsg)
    682684  {
    683         case WM_INITDIALOG:
    684         {         
     685        case WM_INITDIALOG:
     686        {
    685687            fodInfos = (FileOpenDlgInfos *)lParam;
    686688                lParam = (LPARAM) &fodInfos->ofnInfos;
    687                 ArrangeCtrlPositions(hwnd,GetParent(hwnd));
     689                ArrangeCtrlPositions(hwnd,GetParent(hwnd));
    688690            if(fodInfos && (fodInfos->ofnInfos.Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos.lpfnHook)
    689691                 return CallWindowProcA((WNDPROC)fodInfos->ofnInfos.lpfnHook,hwnd,uMsg,wParam,lParam);
    690                 return 0;       
    691         } 
     692                return 0;
     693        }
    692694    }
    693695    if(fodInfos && (fodInfos->ofnInfos.Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos.lpfnHook )
    694         return CallWindowProcA((WNDPROC)fodInfos->ofnInfos.lpfnHook,hwnd,uMsg,wParam,lParam); 
    695   return DefWindowProcA(hwnd,uMsg,wParam,lParam); 
     696        return CallWindowProcA((WNDPROC)fodInfos->ofnInfos.lpfnHook,hwnd,uMsg,wParam,lParam);
     697  return DefWindowProcA(hwnd,uMsg,wParam,lParam);
    696698}
    697699
     
    704706   if (fodInfos->ofnInfos.Flags & OFN_ENABLETEMPLATE || fodInfos->ofnInfos.Flags & OFN_ENABLETEMPLATEHANDLE)
    705707   {
    706         if (fodInfos->ofnInfos.Flags  & OFN_ENABLETEMPLATEHANDLE)
    707         {
     708        if (fodInfos->ofnInfos.Flags  & OFN_ENABLETEMPLATEHANDLE)
     709        {
    708710           if( !(template = LockResource( fodInfos->ofnInfos.hInstance)))
    709                 {
    710                 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
    711                 return (HWND)NULL;
    712                 }
    713                
    714         }
    715         else
    716         {
    717          if (!(hRes = FindResourceA(MapHModuleSL(fodInfos->ofnInfos.hInstance),
     711                {
     712                COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
     713                return (HWND)NULL;
     714                }
     715
     716        }
     717        else
     718        {
     719         if (!(hRes = FindResourceA(MapHModuleSL(fodInfos->ofnInfos.hInstance),
    718720            (fodInfos->ofnInfos.lpTemplateName), RT_DIALOGA)))
    719         {
    720                 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
    721                  return (HWND)NULL;
    722         }
    723         if (!(hDlgTmpl = LoadResource( MapHModuleSL(fodInfos->ofnInfos.hInstance),
     721        {
     722                COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE);
     723                 return (HWND)NULL;
     724        }
     725        if (!(hDlgTmpl = LoadResource( MapHModuleSL(fodInfos->ofnInfos.hInstance),
    724726             hRes )) ||
    725727                 !(template = LockResource( hDlgTmpl )))
    726         {
    727                 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
    728                 return (HWND)NULL;
    729         }
    730         }
    731 
    732         hChildDlg= CreateDialogIndirectParamA(fodInfos->ofnInfos.hInstance,template,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
    733         if(hChildDlg)
    734         {
    735                 ShowWindow(hChildDlg,SW_SHOW);
    736                 return hChildDlg;
    737         }
     728        {
     729                COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE);
     730                return (HWND)NULL;
     731        }
     732        }
     733
     734        hChildDlg= CreateDialogIndirectParamA(fodInfos->ofnInfos.hInstance,template,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
     735        if(hChildDlg)
     736        {
     737                ShowWindow(hChildDlg,SW_SHOW);
     738                return hChildDlg;
     739        }
    738740 }
    739741 else if(fodInfos->ofnInfos.Flags & OFN_ENABLEHOOK && fodInfos->ofnInfos.lpfnHook)
    740742 {
    741         RECT rectHwnd;
    742         DLGTEMPLATE tmplate;
    743         GetClientRect(hwnd,&rectHwnd);
    744         tmplate.style = WS_CHILD | WS_CLIPSIBLINGS;
    745         tmplate.dwExtendedStyle = 0;
    746         tmplate.cdit = 0;
    747         tmplate.x = 0;
    748         tmplate.y = 0;
    749         tmplate.cx = rectHwnd.right-rectHwnd.left;
    750         tmplate.cy = rectHwnd.bottom-rectHwnd.top;
    751        
    752         return CreateDialogIndirectParamA(fodInfos->ofnInfos.hInstance,&tmplate,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
     743        RECT rectHwnd;
     744        DLGTEMPLATE tmplate;
     745        GetClientRect(hwnd,&rectHwnd);
     746        tmplate.style = WS_CHILD | WS_CLIPSIBLINGS;
     747        tmplate.dwExtendedStyle = 0;
     748        tmplate.cdit = 0;
     749        tmplate.x = 0;
     750        tmplate.y = 0;
     751        tmplate.cx = rectHwnd.right-rectHwnd.left;
     752        tmplate.cy = rectHwnd.bottom-rectHwnd.top;
     753
     754        return CreateDialogIndirectParamA(fodInfos->ofnInfos.hInstance,&tmplate,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos);
    753755 }
    754756return (HWND)NULL;
    755757}
    756  
     758
    757759/***********************************************************************
    758760*          SendCustomDlgNotificationMessage
     
    830832    return -1;
    831833}
    832  
     834
    833835/***********************************************************************
    834836 *          FileOpenDlgProc95
     
    841843  {
    842844    case WM_INITDIALOG :
    843          /* Adds the FileOpenDlgInfos in the property list of the dialog 
     845         /* Adds the FileOpenDlgInfos in the property list of the dialog
    844846            so it will be easily accessible through a GetPropA(...) */
    845         SetPropA(hwnd, FileOpenDlgInfosStr, (HANDLE) lParam);
    846 
    847         FILEDLG95_OnWMInitDialog(hwnd, wParam, lParam);
    848          ((FileOpenDlgInfos *)lParam)->DlgInfos.hwndCustomDlg =
    849         CreateTemplateDialog((FileOpenDlgInfos *)lParam,hwnd);
     847        SetPropA(hwnd, FileOpenDlgInfosStr, (HANDLE) lParam);
     848
     849        FILEDLG95_OnWMInitDialog(hwnd, wParam, lParam);
     850         ((FileOpenDlgInfos *)lParam)->DlgInfos.hwndCustomDlg =
     851        CreateTemplateDialog((FileOpenDlgInfos *)lParam,hwnd);
    850852         SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE);
    851853         return 0;
     
    862864      }
    863865      return FALSE;
    864          
     866
    865867    case WM_GETISHELLBROWSER:
    866868      return FILEDLG95_OnWMGetIShellBrowser(hwnd);
     
    889891
    890892#ifndef __WIN32OS2__
    891   /* Make sure the common control DLL is loaded */     
     893  /* Make sure the common control DLL is loaded */
    892894  InitCommonControls();
    893895#endif
     
    992994  /* Do not use the listview selection anymore */
    993995  fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW;
    994   return 0; 
     996  return 0;
    995997}
    996998
     
    10091011  SetWindowLongA(hwnd,DWL_MSGRESULT,(LONG)fodInfos->Shell.FOIShellBrowser);
    10101012
    1011   return TRUE; 
     1013  return TRUE;
    10121014}
    10131015
     
    10291031  TBADDBITMAP tba = { HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR };
    10301032  RECT rectTB;
    1031  
     1033
    10321034  FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);
    10331035
     
    10431045  MapWindowPoints( 0, hwnd,(LPPOINT)&rectTB,2);
    10441046
    1045   fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL, 
     1047  fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL,
    10461048        WS_CHILD | WS_GROUP | TBSTYLE_TOOLTIPS | CCS_NODIVIDER | CCS_NORESIZE,
    10471049        0, 0, 150, 26,
    1048         hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL);
    1049  
    1050   SetWindowPos(fodInfos->DlgInfos.hwndTB, 0, 
    1051         rectTB.left,rectTB.top, rectTB.right-rectTB.left, rectTB.bottom-rectTB.top,
    1052         SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
     1050        hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL);
     1051
     1052  SetWindowPos(fodInfos->DlgInfos.hwndTB, 0,
     1053        rectTB.left,rectTB.top, rectTB.right-rectTB.left, rectTB.bottom-rectTB.top,
     1054        SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER );
    10531055
    10541056  SendMessageA(fodInfos->DlgInfos.hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);
     
    10591061
    10601062  SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBUTTONSA, (WPARAM) 6,(LPARAM) &tbb);
    1061   SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0); 
     1063  SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0);
    10621064
    10631065  /* Set the window text with the text specified in the OPENFILENAME structure */
     
    10981100 *
    10991101 * Ok button WM_COMMAND message handler
    1100  * 
     1102 *
    11011103 * If the function succeeds, the return value is nonzero.
    11021104 */
     
    11321134      char lpstrPathAndFile[MAX_PATH];
    11331135
    1134       lpstrPathSpec[0]    = '\0';
     1136      lpstrPathSpec[0]    = '\0';
    11351137      lpstrCurrentDir[0]  = '\0';
    11361138      lpstrPathAndFile[0] = '\0';
    11371139
    1138       /* Separate the file spec from the path spec 
    1139          e.g.:
    1140               lpstrSpecifiedByUser  lpstrPathSpec  lpstrFileSpec
    1141               C:\TEXT1\TEXT2        C:\TEXT1          TEXT2
    1142       */     
     1140      /* Separate the file spec from the path spec
     1141         e.g.:
     1142              lpstrSpecifiedByUser  lpstrPathSpec  lpstrFileSpec
     1143              C:\TEXT1\TEXT2        C:\TEXT1          TEXT2
     1144      */
    11431145      lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA(lpstrSpecifiedByUser);
    11441146      strcpy(lpstrPathSpec,lpstrSpecifiedByUser);
    11451147      COMDLG32_PathRemoveFileSpecA(lpstrPathSpec);
    1146      
     1148
    11471149      /* Get the index of the selected item in the filetype combo box */
    11481150      fodInfos->ofnInfos.nFilterIndex = (DWORD) CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
     
    11521154      /* Get the current directory name */
    11531155      COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,
    1154                                     lpstrCurrentDir);
    1155 
    1156       /* Create an absolute path name */ 
     1156                                    lpstrCurrentDir);
     1157
     1158      /* Create an absolute path name */
    11571159      if(lpstrSpecifiedByUser[1] != ':')
    11581160      {
    11591161          switch(lpstrSpecifiedByUser[0])
    11601162          {
    1161           /* Add drive spec  \TEXT => C:\TEXT */
    1162           case '\\':
    1163               {
     1163          /* Add drive spec  \TEXT => C:\TEXT */
     1164          case '\\':
     1165              {
    11641166              int lenPathSpec=strlen(lpstrPathSpec);
    11651167              INT iCopy = (lenPathSpec!=0?2:3);
    11661168              memmove(lpstrPathSpec+iCopy,lpstrPathSpec,lenPathSpec);
    1167               strncpy(lpstrPathSpec,lpstrCurrentDir,iCopy);
    1168               }
    1169               break;           
    1170           /* Go to parent ..\TEXT */ 
    1171           case '.':
    1172               {
    1173                   INT iSize;
    1174                   char lpstrTmp2[MAX_PATH];
    1175                   LPSTR lpstrTmp = strrchr(lpstrCurrentDir,'\\');
    1176 
    1177                   iSize = lpstrTmp - lpstrCurrentDir;
    1178                   strncpy(lpstrTmp2,lpstrCurrentDir,iSize + 1);
    1179                   if(strlen(lpstrSpecifiedByUser) <= 3)
     1169              strncpy(lpstrPathSpec,lpstrCurrentDir,iCopy);
     1170              }
     1171              break;
     1172          /* Go to parent ..\TEXT */
     1173          case '.':
     1174              {
     1175                  INT iSize;
     1176                  char lpstrTmp2[MAX_PATH];
     1177                  LPSTR lpstrTmp = strrchr(lpstrCurrentDir,'\\');
     1178
     1179                  iSize = lpstrTmp - lpstrCurrentDir;
     1180                  strncpy(lpstrTmp2,lpstrCurrentDir,iSize + 1);
     1181                  if(strlen(lpstrSpecifiedByUser) <= 3)
    11801182                  *lpstrFileSpec='\0';
    1181                   if(strcmp(lpstrPathSpec,".."))
    1182                       strcat(lpstrTmp2,&lpstrPathSpec[3]);
    1183                   strcpy(lpstrPathSpec,lpstrTmp2);
    1184               }
    1185               break;
    1186           default:
    1187   {
    1188                   char lpstrTmp[MAX_PATH];
    1189 
    1190                   if(strcmp(&lpstrCurrentDir[strlen(lpstrCurrentDir)-1],"\\"))
    1191                       strcat(lpstrCurrentDir,"\\");
    1192                   strcpy(lpstrTmp,lpstrCurrentDir);
    1193                   strcat(lpstrTmp,lpstrPathSpec);
    1194                   strcpy(lpstrPathSpec,lpstrTmp);
    1195               }
    1196                  
     1183                  if(strcmp(lpstrPathSpec,".."))
     1184                      strcat(lpstrTmp2,&lpstrPathSpec[3]);
     1185                  strcpy(lpstrPathSpec,lpstrTmp2);
     1186              }
     1187              break;
     1188          default:
     1189  {
     1190                  char lpstrTmp[MAX_PATH];
     1191
     1192                  if(strcmp(&lpstrCurrentDir[strlen(lpstrCurrentDir)-1],"\\"))
     1193                      strcat(lpstrCurrentDir,"\\");
     1194                  strcpy(lpstrTmp,lpstrCurrentDir);
     1195                  strcat(lpstrTmp,lpstrPathSpec);
     1196                  strcpy(lpstrPathSpec,lpstrTmp);
     1197              }
     1198
    11971199          } /* end switch */
    11981200      }
     
    12001202      if(strlen(lpstrPathSpec))
    12011203      {
    1202           /* Browse to the right directory */
    1203           COMDLG32_SHGetDesktopFolder(&psfDesktop);
    1204           if((browsePidl = GetPidlFromName(psfDesktop,lpstrPathSpec)))
    1205           {
    1206               /* Browse to directory */
    1207               IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,
    1208                                         browsePidl,
    1209                                         SBSP_ABSOLUTE);
    1210               COMDLG32_SHFree(browsePidl);
    1211           }
    1212           else
    1213           {
    1214               /* Path does not exist */
    1215               if(fodInfos->ofnInfos.Flags & OFN_PATHMUSTEXIST)
    1216               {
    1217                   MessageBoxA(hwnd,
    1218                               "Path does not exist",
    1219                               fodInfos->ofnInfos.lpstrTitle,
    1220                               MB_OK | MB_ICONEXCLAMATION);
    1221                   return FALSE;
    1222               }
    1223           }
    1224          
    1225           strcat(lpstrPathAndFile,lpstrPathSpec);
    1226           IShellFolder_Release(psfDesktop);
     1204          /* Browse to the right directory */
     1205          COMDLG32_SHGetDesktopFolder(&psfDesktop);
     1206          if((browsePidl = GetPidlFromName(psfDesktop,lpstrPathSpec)))
     1207          {
     1208              /* Browse to directory */
     1209              IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,
     1210                                        browsePidl,
     1211                                        SBSP_ABSOLUTE);
     1212              COMDLG32_SHFree(browsePidl);
     1213          }
     1214          else
     1215          {
     1216              /* Path does not exist */
     1217              if(fodInfos->ofnInfos.Flags & OFN_PATHMUSTEXIST)
     1218              {
     1219                  MessageBoxA(hwnd,
     1220                              "Path does not exist",
     1221                              fodInfos->ofnInfos.lpstrTitle,
     1222                              MB_OK | MB_ICONEXCLAMATION);
     1223                  return FALSE;
     1224              }
     1225          }
     1226
     1227          strcat(lpstrPathAndFile,lpstrPathSpec);
     1228          IShellFolder_Release(psfDesktop);
    12271229      }
    12281230      else
    12291231      {
    1230           strcat(lpstrPathAndFile,lpstrCurrentDir);
     1232          strcat(lpstrPathAndFile,lpstrCurrentDir);
    12311233      }
    12321234
     
    12341236      COMDLG32_PathAddBackslashA(lpstrPathAndFile);
    12351237      strcat(lpstrPathAndFile,lpstrFileSpec);
    1236      
     1238
    12371239      /* Update the edit field */
    12381240      SetDlgItemTextA(hwnd,IDC_FILENAME,lpstrFileSpec);
    12391241      SendDlgItemMessageA(hwnd,IDC_FILENAME,EM_SETSEL,0,-1);
    1240      
     1242
    12411243      /* Don't go further if we dont have a file spec */
    12421244      if(!strlen(lpstrFileSpec) || !strcmp(lpstrFileSpec,lpstrPathSpec))
    1243           return FALSE;
    1244 
    1245       /* Time to check lpstrFileSpec         */ 
     1245          return FALSE;
     1246
     1247      /* Time to check lpstrFileSpec         */
    12461248      /* search => contains * or ?           */
    12471249      /* browse => contains a directory name */
     
    12571259         MemFree((LPVOID)fodInfos->ShellInfos.lpstrCurrentFilter);
    12581260
    1259           fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFileSpec)+1)*2);
    1260           lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter,
    1261                       (LPSTR)strlwr((LPSTR)lpstrFileSpec));
    1262      
     1261          fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFileSpec)+1)*2);
     1262          lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter,
     1263                      (LPSTR)strlwr((LPSTR)lpstrFileSpec));
     1264
    12631265      IShellView_Refresh(fodInfos->Shell.FOIShellView);
    12641266
    1265           if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB,
    1266                                                        lpstrFileSpec)))
     1267          if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB,
     1268                                                       lpstrFileSpec)))
    12671269        CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB,iPos);
    12681270
     
    12721274      /* browse if the user specified a directory */
    12731275      browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder,
    1274               lpstrFileSpec);
     1276              lpstrFileSpec);
    12751277      if (!browsePidl) /* not a directory check the specified file exists */
    12761278      {
    1277           int iExt;
    1278           char lpstrFileSpecTemp[MAX_PATH] = "";
    1279           LPSTR lpstrExt;
    1280           LPSTR lpOrg;
    1281           LPSTR lpBuf;
    1282           iExt = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
    1283           lpOrg = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, iExt);
    1284           lpstrExt = lpOrg;
    1285 
    1286           /*
    1287              add user specified extentions to the file one by one and
    1288              check if the file exists
    1289         */
    1290           while(lpOrg)
    1291         {
    1292              int i;
    1293              if ((lpstrExt = strchr(lpOrg, ';')))
    1294              {
    1295                 i = lpstrExt - lpOrg;
    1296              }
    1297              else
    1298                 i = strlen(lpOrg);
    1299              lpBuf = MemAlloc(i+1);
    1300              strncpy(lpBuf, lpOrg, i);
    1301              lpBuf[i] = 0;
    1302              strcpy(lpstrFileSpecTemp, lpstrFileSpec);
    1303              if (lpstrFileSpecTemp[strlen(lpstrFileSpecTemp)-1] == '.')
    1304              {
    1305                 if (strchr(lpBuf, '.'))
    1306                      strcat(lpstrFileSpecTemp, (strchr(lpBuf, '.')) + 1);
    1307              } else {
    1308                 if (strchr(lpBuf, '.'))
    1309                      strcat(lpstrFileSpecTemp, strchr(lpBuf, '.'));
    1310              }
    1311              browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder,
    1312                      lpstrFileSpecTemp);
    1313              MemFree((void *)lpBuf);
    1314              if (browsePidl)
    1315              {
    1316                 strcpy(lpstrFileSpec,lpstrFileSpecTemp);
    1317                 break;
    1318              }
    1319              if (lpstrExt)
    1320                 lpOrg = lpstrExt+1;
    1321              else
    1322                 lpOrg = NULL;
    1323         }
     1279          int iExt;
     1280          char lpstrFileSpecTemp[MAX_PATH] = "";
     1281          LPSTR lpstrExt;
     1282          LPSTR lpOrg;
     1283          LPSTR lpBuf;
     1284          iExt = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
     1285          lpOrg = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, iExt);
     1286          lpstrExt = lpOrg;
     1287
     1288          /*
     1289             add user specified extentions to the file one by one and
     1290             check if the file exists
     1291        */
     1292          while(lpOrg)
     1293        {
     1294             int i;
     1295             if ((lpstrExt = strchr(lpOrg, ';')))
     1296             {
     1297                i = lpstrExt - lpOrg;
     1298             }
     1299             else
     1300                i = strlen(lpOrg);
     1301             lpBuf = MemAlloc(i+1);
     1302             strncpy(lpBuf, lpOrg, i);
     1303             lpBuf[i] = 0;
     1304             strcpy(lpstrFileSpecTemp, lpstrFileSpec);
     1305             if (lpstrFileSpecTemp[strlen(lpstrFileSpecTemp)-1] == '.')
     1306             {
     1307                if (strchr(lpBuf, '.'))
     1308                     strcat(lpstrFileSpecTemp, (strchr(lpBuf, '.')) + 1);
     1309             } else {
     1310                if (strchr(lpBuf, '.'))
     1311                     strcat(lpstrFileSpecTemp, strchr(lpBuf, '.'));
     1312             }
     1313             browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder,
     1314                     lpstrFileSpecTemp);
     1315             MemFree((void *)lpBuf);
     1316             if (browsePidl)
     1317             {
     1318                strcpy(lpstrFileSpec,lpstrFileSpecTemp);
     1319                break;
     1320             }
     1321             if (lpstrExt)
     1322                lpOrg = lpstrExt+1;
     1323             else
     1324                lpOrg = NULL;
     1325        }
    13241326      }
    13251327
     
    13271329      {
    13281330          ULONG  ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
    1329           int    nMsgBoxRet;
    1330           char   lpstrFileExist[MAX_PATH + 50];
    1331 
    1332           IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 
    1333                                        1,
    1334                                        &browsePidl,
    1335                                        &ulAttr);
    1336 
    1337           /* Browse to directory if it is a folder */
    1338           if (ulAttr & SFGAO_FOLDER)
    1339           {
    1340               if(FAILED(IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,
    1341                                                    browsePidl,
    1342                                                    SBSP_RELATIVE)))
     1331          int    nMsgBoxRet;
     1332          char   lpstrFileExist[MAX_PATH + 50];
     1333
     1334          IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder,
     1335                                       1,
     1336                                       &browsePidl,
     1337                                       &ulAttr);
     1338
     1339          /* Browse to directory if it is a folder */
     1340          if (ulAttr & SFGAO_FOLDER)
     1341          {
     1342              if(FAILED(IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,
     1343                                                   browsePidl,
     1344                                                   SBSP_RELATIVE)))
    13431345        {
    1344                   if(fodInfos->ofnInfos.Flags & OFN_PATHMUSTEXIST)
     1346                  if(fodInfos->ofnInfos.Flags & OFN_PATHMUSTEXIST)
    13451347        {
    1346                       MessageBoxA(hwnd,
    1347                                   "Path does not exist",
    1348                                   fodInfos->ofnInfos.lpstrTitle,
    1349                                   MB_OK | MB_ICONEXCLAMATION);
    1350                       COMDLG32_SHFree(browsePidl);
    1351                       return FALSE;
     1348                      MessageBoxA(hwnd,
     1349                                  "Path does not exist",
     1350                                  fodInfos->ofnInfos.lpstrTitle,
     1351                                  MB_OK | MB_ICONEXCLAMATION);
     1352                      COMDLG32_SHFree(browsePidl);
     1353                      return FALSE;
    13521354        }
    13531355    }
    1354               COMDLG32_SHFree(browsePidl);
    1355               return FALSE;
     1356              COMDLG32_SHFree(browsePidl);
     1357              return FALSE;
    13561358    }
    13571359
    1358           /* The file does exist, so ask the user if we should overwrite it */
    1359           if((fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) &&
    1360              (fodInfos->ofnInfos.Flags & OFN_OVERWRITEPROMPT))
    1361           {
    1362                 strcpy(lpstrFileExist, lpstrFileSpec);
    1363                 strcat(lpstrFileExist, " already exists.\nDo you want to replace it?");
    1364 
    1365                 nMsgBoxRet = MessageBoxA(hwnd,
    1366                                         lpstrFileExist,
    1367                                         fodInfos->ofnInfos.lpstrTitle,
    1368                                         MB_YESNO | MB_ICONEXCLAMATION);
    1369                 if (nMsgBoxRet == IDNO)
    1370                 {
    1371                     COMDLG32_SHFree(browsePidl);
    1372                     return FALSE;
    1373                 }
    1374           }
    1375           COMDLG32_SHFree(browsePidl);
     1360          /* The file does exist, so ask the user if we should overwrite it */
     1361          if((fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) &&
     1362             (fodInfos->ofnInfos.Flags & OFN_OVERWRITEPROMPT))
     1363          {
     1364                strcpy(lpstrFileExist, lpstrFileSpec);
     1365                strcat(lpstrFileExist, " already exists.\nDo you want to replace it?");
     1366
     1367                nMsgBoxRet = MessageBoxA(hwnd,
     1368                                        lpstrFileExist,
     1369                                        fodInfos->ofnInfos.lpstrTitle,
     1370                                        MB_YESNO | MB_ICONEXCLAMATION);
     1371                if (nMsgBoxRet == IDNO)
     1372                {
     1373                    COMDLG32_SHFree(browsePidl);
     1374                    return FALSE;
     1375                }
     1376          }
     1377          COMDLG32_SHFree(browsePidl);
    13761378      }
    13771379      else
    13781380    {
    1379           /* File does not exist in current directory */
    1380 
    1381           /* The selected file does not exist */
     1381          /* File does not exist in current directory */
     1382
     1383          /* The selected file does not exist */
    13821384      /* Tell the user the selected does not exist */
    13831385      if(fodInfos->ofnInfos.Flags & OFN_FILEMUSTEXIST)
     
    13871389        char tmp[400];
    13881390
    1389               LoadStringA(COMMDLG_hInstance32,
    1390                           IDS_FILENOTFOUND,
    1391                           lpstrNotFound,
    1392                           100);
    1393               LoadStringA(COMMDLG_hInstance32,
    1394                           IDS_VERIFYFILE,
    1395                           lpstrMsg,
    1396                           100);
     1391              LoadStringA(COMMDLG_hInstance32,
     1392                          IDS_FILENOTFOUND,
     1393                          lpstrNotFound,
     1394                          100);
     1395              LoadStringA(COMMDLG_hInstance32,
     1396                          IDS_VERIFYFILE,
     1397                          lpstrMsg,
     1398                          100);
    13971399
    13981400        strcpy(tmp,fodInfos->ofnInfos.lpstrFile);
     
    14021404        strcat(tmp,lpstrMsg);
    14031405
    1404               MessageBoxA(hwnd,
    1405                           tmp,
    1406                           fodInfos->ofnInfos.lpstrTitle,
    1407                           MB_OK | MB_ICONEXCLAMATION);
    1408         return FALSE;
     1406              MessageBoxA(hwnd,
     1407                          tmp,
     1408                          fodInfos->ofnInfos.lpstrTitle,
     1409                          MB_OK | MB_ICONEXCLAMATION);
     1410        return FALSE;
    14091411      }
    14101412      /* Ask the user if he wants to create the file*/
     
    14151417        LoadStringA(COMMDLG_hInstance32,IDS_CREATEFILE,tmp,100);
    14161418
    1417               if(IDYES == MessageBoxA(hwnd,tmp,fodInfos->ofnInfos.lpstrTitle,
    1418                                       MB_YESNO | MB_ICONQUESTION))
     1419              if(IDYES == MessageBoxA(hwnd,tmp,fodInfos->ofnInfos.lpstrTitle,
     1420                                      MB_YESNO | MB_ICONQUESTION))
    14191421        {
    14201422            /* Create the file, clean and exit */
     
    14221424            return EndDialog(hwnd,TRUE);
    14231425        }
    1424         return FALSE;       
     1426        return FALSE;
    14251427      }
    14261428    }
     
    14311433      if(!strrchr(lpstrPathAndFile,'.'))
    14321434      {
    1433           /* if the file has no extension, append the selected
    1434              extension of the filetype combo box */
    1435           int iExt;
    1436           LPSTR lpstrExt;
    1437           iExt = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
    1438           lpstrTemp = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,iExt);
    1439 
    1440           if((LPSTR)-1 != lpstrTemp)
    1441           {
    1442               if((lpstrExt = strchr(lpstrTemp,';')))
    1443               {
    1444                   int i = lpstrExt - lpstrTemp;
    1445                   lpstrExt = MemAlloc(i);
    1446                   strncpy(lpstrExt,&lpstrTemp[1],i-1);
    1447               }
    1448               else
    1449               {
    1450                   lpstrExt = MemAlloc(strlen(lpstrTemp));
    1451                   strcpy(lpstrExt,&lpstrTemp[1]);
    1452               }
    1453                  
    1454               if(!strcmp(&lpstrExt[1],"*") && fodInfos->ofnInfos.lpstrDefExt)
    1455               {
    1456                   lpstrExt = MemAlloc(strlen(fodInfos->ofnInfos.lpstrDefExt)+2);
    1457                   strcat(lpstrExt,".");
    1458                   strcat(lpstrExt,(LPSTR) fodInfos->ofnInfos.lpstrDefExt);
    1459               }
    1460               strcat(lpstrPathAndFile,lpstrExt);
    1461           }
     1435          /* if the file has no extension, append the selected
     1436             extension of the filetype combo box */
     1437          int iExt;
     1438          LPSTR lpstrExt;
     1439          iExt = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
     1440          lpstrTemp = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,iExt);
     1441
     1442          if((LPSTR)-1 != lpstrTemp)
     1443          {
     1444              if((lpstrExt = strchr(lpstrTemp,';')))
     1445              {
     1446                  int i = lpstrExt - lpstrTemp;
     1447                  lpstrExt = MemAlloc(i);
     1448                  strncpy(lpstrExt,&lpstrTemp[1],i-1);
     1449              }
     1450              else
     1451              {
     1452                  lpstrExt = MemAlloc(strlen(lpstrTemp));
     1453                  strcpy(lpstrExt,&lpstrTemp[1]);
     1454              }
     1455
     1456              if(!strcmp(&lpstrExt[1],"*") && fodInfos->ofnInfos.lpstrDefExt)
     1457              {
     1458                  lpstrExt = MemAlloc(strlen(fodInfos->ofnInfos.lpstrDefExt)+2);
     1459                  strcat(lpstrExt,".");
     1460                  strcat(lpstrExt,(LPSTR) fodInfos->ofnInfos.lpstrDefExt);
     1461              }
     1462              strcat(lpstrPathAndFile,lpstrExt);
     1463          }
    14621464      }
    14631465      /* Check that size size of the file does not exceed buffer size */
    14641466      if(strlen(lpstrPathAndFile) > fodInfos->ofnInfos.nMaxFile)
    14651467      {
    1466           /* set error FNERR_BUFFERTOSMALL */
    1467           FILEDLG95_Clean(hwnd);
    1468           return EndDialog(hwnd,FALSE);
     1468          /* set error FNERR_BUFFERTOSMALL */
     1469          FILEDLG95_Clean(hwnd);
     1470          return EndDialog(hwnd,FALSE);
    14691471      }
    14701472      strcpy(fodInfos->ofnInfos.lpstrFile,lpstrPathAndFile);
     
    14721474      /* Set the lpstrFileTitle of the OPENFILENAME structure */
    14731475      if(fodInfos->ofnInfos.lpstrFileTitle)
    1474           strncpy(fodInfos->ofnInfos.lpstrFileTitle,
    1475                   lpstrFileSpec,
    1476                   fodInfos->ofnInfos.nMaxFileTitle);
    1477 
    1478       /* Check if the file is to be opened as read only */           
     1476          strncpy(fodInfos->ofnInfos.lpstrFileTitle,
     1477                  lpstrFileSpec,
     1478                  fodInfos->ofnInfos.nMaxFileTitle);
     1479
     1480      /* Check if the file is to be opened as read only */
    14791481      if(BST_CHECKED == SendDlgItemMessageA(hwnd,
    1480                                             IDC_OPENREADONLY,
    1481                                             BM_GETSTATE,0,0))
    1482           SetFileAttributesA(fodInfos->ofnInfos.lpstrFile,
    1483                              FILE_ATTRIBUTE_READONLY);
     1482                                            IDC_OPENREADONLY,
     1483                                            BM_GETSTATE,0,0))
     1484          SetFileAttributesA(fodInfos->ofnInfos.lpstrFile,
     1485                             FILE_ATTRIBUTE_READONLY);
    14841486
    14851487      /*  nFileExtension and nFileOffset of OPENFILENAME structure */
     
    14891491      fodInfos->ofnInfos.nFileExtension = lpstrTemp - fodInfos->ofnInfos.lpstrFile + 1;
    14901492
    1491    
     1493
    14921494    /* clean and exit */
    14931495    FILEDLG95_Clean(hwnd);
     
    15101512
    15111513  /*
    1512    * Initialisation of the FileOpenDialogInfos structure 
     1514   * Initialisation of the FileOpenDialogInfos structure
    15131515   */
    15141516
     
    15301532
    15311533  /* Construct the IShellBrowser interface */
    1532   fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd); 
    1533    
     1534  fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd);
     1535
    15341536  return NOERROR;
    15351537}
     
    15501552
    15511553  if(SUCCEEDED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView,
    1552                                         SVGIO_BACKGROUND,
    1553                                         &IID_IContextMenu,
    1554                                         (LPVOID*)&pcm)))
     1554                                        SVGIO_BACKGROUND,
     1555                                        &IID_IContextMenu,
     1556                                        (LPVOID*)&pcm)))
    15551557  {
    15561558    ci.cbSize = sizeof(CMINVOKECOMMANDINFO);
     
    15891591 *      FILEDLG95_SHELL_NewFolder
    15901592 *
    1591  * Creates a new directory with New folder as name 
     1593 * Creates a new directory with New folder as name
    15921594 * If the function succeeds, the return value is nonzero.
    15931595 * FIXME: let the contextmenu (CMDSTR_NEWFOLDER) do this thing
     
    16301632  {
    16311633    bRes = CreateDirectoryA(lpstrNewDir,NULL);
    1632  
     1634
    16331635    if(bRes)
    16341636    {
     
    16501652      char lpstrTempText[128];
    16511653      char lpstrCaption[256];
    1652      
     1654
    16531655      /* Cannot Create folder because of permissions */
    16541656      LoadStringA(COMMDLG_hInstance32, IDS_CREATEFOLDER_DENIED, lpstrTempText, sizeof(lpstrTempText));
     
    16821684 *      FILEDLG95_FILETYPE_Init
    16831685 *
    1684  * Initialisation of the file type combo box 
     1686 * Initialisation of the file type combo box
    16851687 */
    16861688static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
     
    16991701    for(;;)
    17001702    {
    1701       /* filter is a list...  title\0ext\0......\0\0 
     1703      /* filter is a list...  title\0ext\0......\0\0
    17021704       * Set the combo item text to the title and the item data
    17031705       *  to the ext
     
    17191721      if(!lpstrExt)
    17201722          break;
    1721      
     1723
    17221724      strcpy(lpstrExt,lpstrExtTmp);
    17231725
    17241726      iStrIndex += strlen(lpstrExt) +1;
    1725            
     1727
    17261728      /* Add the item at the end of the combo */
    17271729      CBAddString(fodInfos->DlgInfos.hwndFileTypeCB,lpstrTmp);
     
    17291731    }
    17301732      /* Set the current filter to the one specified
    1731        * in the initialisation structure 
     1733       * in the initialisation structure
    17321734      */
    1733  
     1735
    17341736      /* set default filter index */
    17351737      if(fodInfos->ofnInfos.nFilterIndex == 0 && fodInfos->ofnInfos.lpstrCustomFilter == NULL)
     
    17371739      /* First, check to make sure our index isn't out of bounds. */
    17381740      if ( fodInfos->ofnInfos.nFilterIndex > iPos )
    1739         fodInfos->ofnInfos.nFilterIndex = iPos;
    1740  
    1741  
     1741        fodInfos->ofnInfos.nFilterIndex = iPos;
     1742
     1743
    17421744      /* Get the current index selection. */
    17431745      CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB,
    17441746                  fodInfos->ofnInfos.nFilterIndex-1);
    1745  
     1747
    17461748      /* Get the corresponding text string from the combo box. */
    17471749      lpstrFilter = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,
     
    17721774    {
    17731775      LPSTR lpstrFilter;
    1774 
     1776//CB: todo: check if selection really changed
    17751777      /* Get the current item of the filetype combo box */
    17761778      int iItem = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB);
     
    18441846
    18451847}
    1846    
     1848
    18471849/***********************************************************************
    18481850 *      FILEDLG95_LOOKIN_Init
    18491851 *
    1850  * Initialisation of the look in combo box 
     1852 * Initialisation of the look in combo box
    18511853 */
    18521854static HRESULT FILEDLG95_LOOKIN_Init(HWND hwndCombo)
    18531855{
    1854   IShellFolder  *psfRoot, *psfDrives;
    1855   IEnumIDList   *lpeRoot, *lpeDrives;
    1856   LPITEMIDLIST  pidlDrives, pidlTmp, pidlTmp1, pidlAbsTmp;
     1856  IShellFolder  *psfRoot, *psfDrives;
     1857  IEnumIDList   *lpeRoot, *lpeDrives;
     1858  LPITEMIDLIST  pidlDrives, pidlTmp, pidlTmp1, pidlAbsTmp;
    18571859
    18581860  LookInInfos *liInfos = MemAlloc(sizeof(LookInInfos));
     
    18811883      while (S_OK == IEnumIDList_Next(lpeRoot, 1, &pidlTmp, NULL))
    18821884      {
    1883         FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND);
    1884 
    1885         /* special handling for CSIDL_DRIVES */
    1886         if (COMDLG32_PIDL_ILIsEqual(pidlTmp, pidlDrives))
    1887         {
    1888           if(SUCCEEDED(IShellFolder_BindToObject(psfRoot, pidlTmp, NULL, &IID_IShellFolder, (LPVOID*)&psfDrives)))
    1889           {
    1890             /* enumerate the drives */
    1891             if(SUCCEEDED(IShellFolder_EnumObjects(psfDrives, hwndCombo,SHCONTF_FOLDERS, &lpeDrives)))
    1892             {
    1893               while (S_OK == IEnumIDList_Next(lpeDrives, 1, &pidlTmp1, NULL))
    1894               {
    1895                 pidlAbsTmp = COMDLG32_PIDL_ILCombine(pidlTmp, pidlTmp1);
    1896                 FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlAbsTmp,LISTEND);
    1897                 COMDLG32_SHFree(pidlAbsTmp);
    1898                 COMDLG32_SHFree(pidlTmp1);
    1899               }
    1900               IEnumIDList_Release(lpeDrives);
    1901             }
    1902             IShellFolder_Release(psfDrives);
    1903           }
    1904         }
     1885        FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND);
     1886
     1887        /* special handling for CSIDL_DRIVES */
     1888        if (COMDLG32_PIDL_ILIsEqual(pidlTmp, pidlDrives))
     1889        {
     1890          if(SUCCEEDED(IShellFolder_BindToObject(psfRoot, pidlTmp, NULL, &IID_IShellFolder, (LPVOID*)&psfDrives)))
     1891          {
     1892            /* enumerate the drives */
     1893            if(SUCCEEDED(IShellFolder_EnumObjects(psfDrives, hwndCombo,SHCONTF_FOLDERS, &lpeDrives)))
     1894            {
     1895              while (S_OK == IEnumIDList_Next(lpeDrives, 1, &pidlTmp1, NULL))
     1896              {
     1897                pidlAbsTmp = COMDLG32_PIDL_ILCombine(pidlTmp, pidlTmp1);
     1898                FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlAbsTmp,LISTEND);
     1899                COMDLG32_SHFree(pidlAbsTmp);
     1900                COMDLG32_SHFree(pidlTmp1);
     1901              }
     1902              IEnumIDList_Release(lpeDrives);
     1903            }
     1904            IShellFolder_Release(psfDrives);
     1905          }
     1906        }
    19051907        COMDLG32_SHFree(pidlTmp);
    19061908      }
     
    19271929  RECT rectText;
    19281930  RECT rectIcon;
    1929   SHFILEINFOA sfi;
    1930   HIMAGELIST ilItemImage;
    19311931  int iIndentation;
    19321932  LPSFOLDER tmpFolder;
    1933 
    19341933
    19351934  LookInInfos *liInfos = (LookInInfos *)GetPropA(pDIStruct->hwndItem,LookInInfosStr);
     
    19441943    return 0;
    19451944
    1946 
    1947   if(pDIStruct->itemID == liInfos->uSelectedItem)
    1948   {
    1949     ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
    1950                                                0,   
    1951                                                &sfi,   
    1952                                                sizeof (SHFILEINFOA),   
    1953                                                SHGFI_PIDL | SHGFI_SMALLICON |   
    1954                                                SHGFI_OPENICON | SHGFI_SYSICONINDEX    |
    1955                                                SHGFI_DISPLAYNAME );   
    1956   }
    1957   else
    1958   {
    1959     ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
    1960                                                   0,
    1961                                                   &sfi,
     1945  if (!tmpFolder->szDisplayName)
     1946  {
     1947    SHFILEINFOA sfi;
     1948    INT len;
     1949
     1950    tmpFolder->ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR)tmpFolder->pidlItem,
     1951                                                  0,
     1952                                                  &sfi,
    19621953                                                  sizeof (SHFILEINFOA),
    1963                                                   SHGFI_PIDL | SHGFI_SMALLICON |
    1964                                                   SHGFI_SYSICONINDEX |
    1965                                                   SHGFI_DISPLAYNAME);
     1954                                                  SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME);
     1955    len = strlen(sfi.szDisplayName)+1;
     1956    tmpFolder->szDisplayName = MemAlloc(len);
     1957    strcpy(tmpFolder->szDisplayName,sfi.szDisplayName);
     1958    tmpFolder->iIcon = sfi.iIcon;
    19661959  }
    19671960
     
    19811974
    19821975  /* Do not indent item  if drawing in the edit of the combo*/
    1983   if(pDIStruct->itemState & ODS_COMBOBOXEDIT)
    1984   {
     1976  if (pDIStruct->itemState & ODS_COMBOBOXEDIT)
    19851977    iIndentation = 0;
    1986     ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
    1987                                                 0,
    1988                                                 &sfi,
    1989                                                 sizeof (SHFILEINFOA),
    1990                                                 SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON
    1991                                                 | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME  );
    1992 
    1993   }
    19941978  else
    1995   {
    19961979    iIndentation = tmpFolder->m_iIndent;
    1997   }
     1980
    19981981  /* Draw text and icon */
    19991982
     
    20101993  rectText.bottom = pDIStruct->rcItem.bottom;
    20111994
    2012  
     1995
    20131996  /* Draw the icon from the image list */
    2014   COMDLG32_ImageList_Draw(ilItemImage,
    2015                  sfi.iIcon,
    2016                  pDIStruct->hDC, 
    2017                  rectIcon.left, 
    2018                  rectIcon.top, 
    2019                  ILD_TRANSPARENT ); 
     1997  COMDLG32_ImageList_Draw(tmpFolder->ilItemImage,
     1998                 tmpFolder->iIcon,
     1999                 pDIStruct->hDC,
     2000                 rectIcon.left,
     2001                 rectIcon.top,
     2002                 ILD_TRANSPARENT );
    20202003
    20212004  /* Draw the associated text */
    2022   if(sfi.szDisplayName)
    2023     TextOutA(pDIStruct->hDC,rectText.left,rectText.top,sfi.szDisplayName,strlen(sfi.szDisplayName));
     2005  if (tmpFolder->szDisplayName)
     2006    TextOutA(pDIStruct->hDC,rectText.left,rectText.top,tmpFolder->szDisplayName,strlen(tmpFolder->szDisplayName));
    20242007
    20252008
     
    20442027    {
    20452028      LPSFOLDER tmpFolder;
    2046       int iItem; 
     2029      int iItem;
    20472030
    20482031      iItem = CBGetCurSel(fodInfos->DlgInfos.hwndLookInCB);
     
    20502033      if(!(tmpFolder = (LPSFOLDER) CBGetItemDataPtr(fodInfos->DlgInfos.hwndLookInCB,
    20512034                                               iItem)))
    2052         return FALSE;
     2035        return FALSE;
    20532036
    20542037
     
    20612044      break;
    20622045    }
    2063      
     2046
    20642047  }
    20652048  return FALSE;
     
    20832066  if(!(liInfos = (LookInInfos *)GetPropA(hwnd,LookInInfosStr)))
    20842067    return -1;
    2085    
     2068
    20862069  tmpFolder->m_iIndent = 0;
     2070  tmpFolder->szDisplayName = NULL;
    20872071
    20882072  if(!pidl)
     
    21002084  if(tmpFolder->m_iIndent > liInfos->iMaxIndentation)
    21012085    liInfos->iMaxIndentation = tmpFolder->m_iIndent;
    2102  
     2086
    21032087  COMDLG32_SHGetFileInfoA((LPSTR)pidl,
    21042088                  0,
    21052089                  &sfi,
    21062090                  sizeof(sfi),
    2107                   SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX
    2108                   | SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_ATTRIBUTES);
    2109 
     2091                  SHGFI_ATTRIBUTES);
    21102092
    21112093  if((sfi.dwAttributes & SFGAO_FILESYSANCESTOR) || (sfi.dwAttributes & SFGAO_FILESYSTEM))
    2112     {
    2113         int iItemID;
     2094  {
     2095    int iItemID;
     2096
    21142097    /* Add the item at the end of the list */
    21152098    if(iInsertId < 0)
    21162099    {
    2117       iItemID = CBAddString(hwnd,sfi.szDisplayName);
     2100      iItemID = CBAddString(hwnd,NULL);
    21182101    }
    21192102    /* Insert the item at the iInsertId position*/
    21202103    else
    21212104    {
    2122       iItemID = CBInsertString(hwnd,sfi.szDisplayName,iInsertId);
     2105      iItemID = CBInsertString(hwnd,NULL,iInsertId);
    21232106    }
    21242107
     
    21342117 *      FILEDLG95_LOOKIN_InsertItemAfterParent
    21352118 *
    2136  * Insert an item below its parent 
     2119 * Insert an item below its parent
    21372120 */
    21382121static int FILEDLG95_LOOKIN_InsertItemAfterParent(HWND hwnd,LPITEMIDLIST pidl)
    21392122{
    2140  
     2123
    21412124  LPITEMIDLIST pidlParent = GetParentPidl(pidl);
    21422125  int iParentPos;
     
    21932176    }
    21942177  }
    2195  
     2178
    21962179  CBSetCurSel(hwnd,iItemPos);
    21972180  liInfos->uSelectedItem = iItemPos;
     
    22202203  {
    22212204    SFOLDER *tmpFolder;
     2205
    22222206    tmpFolder = (LPSFOLDER) CBGetItemDataPtr(hwnd,iItemPos);
     2207    if (tmpFolder->szDisplayName) MemFree(tmpFolder->szDisplayName);
     2208    MemFree(tmpFolder);
    22232209    CBDeleteString(hwnd,iItemPos);
    22242210    liInfos->iMaxIndentation--;
     
    22732259    for(iPos = iCount-1;iPos>=0;iPos--)
    22742260    {
    2275         MemFree((LPVOID)(CBGetItemDataPtr(fodInfos->DlgInfos.hwndLookInCB,iPos)));
    2276         CBDeleteString(fodInfos->DlgInfos.hwndLookInCB,iPos);
     2261      SFOLDER *tmpFolder = (LPSFOLDER)CBGetItemDataPtr(fodInfos->DlgInfos.hwndLookInCB,iPos);
     2262
     2263      if (tmpFolder->szDisplayName) MemFree(tmpFolder->szDisplayName);
     2264      MemFree(tmpFolder);
     2265      CBDeleteString(fodInfos->DlgInfos.hwndLookInCB,iPos);
    22772266    }
    22782267    /* LookInInfos structure */
     
    22872276 *      GetName
    22882277 *
    2289  * Get the pidl's display name (relative to folder) and 
     2278 * Get the pidl's display name (relative to folder) and
    22902279 * put it in lpstrFileName.
    2291  * 
     2280 *
    22922281 * Return NOERROR on success,
    22932282 * E_FAIL otherwise
     
    23122301  /* Get the display name of the pidl relative to the folder */
    23132302  if (SUCCEEDED(hRes = IShellFolder_GetDisplayNameOf(lpsf,
    2314                                                      pidl, 
    2315                                                      dwFlags, 
     2303                                                     pidl,
     2304                                                     dwFlags,
    23162305                                                     &str)))
    23172306  {
     
    23242313 *      GetShellFolderFromPidl
    23252314 *
    2326  * pidlRel is the item pidl relative 
     2315 * pidlRel is the item pidl relative
    23272316 * Return the IShellFolder of the absolute pidl
    23282317 */
     
    23402329      if(SUCCEEDED(IShellFolder_BindToObject(psfParent, pidlAbs, NULL, &IID_IShellFolder, (LPVOID*)&psf)))
    23412330      {
    2342         IShellFolder_Release(psfParent);
     2331        IShellFolder_Release(psfParent);
    23432332        return psf;
    23442333      }
     
    23632352  pidlParent = COMDLG32_PIDL_ILClone(pidl);
    23642353  COMDLG32_PIDL_ILRemoveLastID(pidlParent);
    2365      
     2354
    23662355  return pidlParent;
    23672356}
     
    23702359 *      GetPidlFromName
    23712360 *
    2372  * returns the pidl of the file name relative to folder 
     2361 * returns the pidl of the file name relative to folder
    23732362 * NULL if an error occured
    23742363 */
     
    23842373  if(!lpcstrFileName)
    23852374    return NULL;
    2386    
     2375
    23872376  MultiByteToWideChar(CP_ACP,
    2388                       MB_PRECOMPOSED,   
    2389                       lpcstrFileName, 
    2390                       -1, 
    2391                       (LPWSTR)lpwstrDirName, 
    2392                       MAX_PATH); 
     2377                      MB_PRECOMPOSED,
     2378                      lpcstrFileName,
     2379                      -1,
     2380                      (LPWSTR)lpwstrDirName,
     2381                      MAX_PATH);
    23932382
    23942383  IShellFolder_ParseDisplayName(psf,                                0,
     
    23972386                                             &ulEaten,
    23982387                                             &pidl,
    2399                                 NULL);   
     2388                                NULL);
    24002389
    24012390    return pidl;
Note: See TracChangeset for help on using the changeset viewer.