Changeset 5583 for trunk/src


Ignore:
Timestamp:
Apr 24, 2001, 10:37:25 PM (24 years ago)
Author:
sandervl
Message:

Wine resync

Location:
trunk/src/comdlg32
Files:
7 edited

Legend:

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

    r4514 r5583  
    870870   if (!(lpp->lpcc->Flags & CC_SHOWHELP))
    871871      ShowWindow( GetDlgItem(hDlg,0x40e), SW_HIDE);
    872    lpp->msetrgb = RegisterWindowMessageA(SETRGBSTRING);
     872   lpp->msetrgb = RegisterWindowMessageA(SETRGBSTRINGA);
    873873
    874874#if 0
     
    10571057
    10581058          case 0x40e:           /* Help! */ /* The Beatles, 1965  ;-) */
    1059                i = RegisterWindowMessageA(HELPMSGSTRING);
     1059               i = RegisterWindowMessageA(HELPMSGSTRINGA);
    10601060#ifndef __WIN32OS2__
    10611061               if (lpp->lpcc16)
     
    10811081
    10821082          case IDOK :
    1083                 cokmsg = RegisterWindowMessageA(COLOROKSTRING);
     1083                cokmsg = RegisterWindowMessageA(COLOROKSTRINGA);
    10841084#ifndef __WIN32OS2__
    10851085                if (lpp->lpcc16)
  • trunk/src/comdlg32/comdlgguid.cpp

    r1548 r5583  
    1 /* $Id: comdlgguid.cpp,v 1.1 1999-11-02 19:09:42 sandervl Exp $ */
     1/* $Id: comdlgguid.cpp,v 1.2 2001-04-24 20:37:24 sandervl Exp $ */
    22
    33/*****************************************************************************
     
    2525#include <wine/obj_shellextinit.h>
    2626#include <wine/obj_shellbrowser.h>
     27#include <wine/obj_serviceprovider.h>
    2728#include <docobj.h>
    2829
  • trunk/src/comdlg32/filedlg.c

    r5462 r5583  
    135135        if (!hNet) hNet = LoadImageA(0, MAKEINTRESOURCEA(OIC_NETWORK), IMAGE_ICON, 16, 16, LR_SHARED);
    136136#else
    137         if (!hFolder) hFolder = LoadIconA(0, MAKEINTRESOURCEA(OIC_FOLDER));
    138         if (!hFolder2) hFolder2 = LoadIconA(0, MAKEINTRESOURCEA(OIC_FOLDER2));
    139         if (!hFloppy) hFloppy = LoadIconA(0, MAKEINTRESOURCEA(OIC_FLOPPY));
    140         if (!hHDisk) hHDisk = LoadIconA(0, MAKEINTRESOURCEA(OIC_HDISK));
    141         if (!hCDRom) hCDRom = LoadIconA(0, MAKEINTRESOURCEA(OIC_CDROM));
    142         if (!hNet) hNet = LoadIconA(0, MAKEINTRESOURCEA(OIC_NETWORK));
     137        HINSTANCE inst = GetModuleHandleA( "comdlg32.dll" );
     138        if (!inst)
     139        {
     140            ERR( "cannot get comdlg32.dll instance\n" );
     141            return FALSE;
     142        }
     143        hFolder  = LoadImageA( inst, "FOLDER", IMAGE_ICON, 16, 16, LR_SHARED );
     144        hFolder2 = LoadImageA( inst, "FOLDER2", IMAGE_ICON, 16, 16, LR_SHARED );
     145        hFloppy  = LoadImageA( inst, "FLOPPY", IMAGE_ICON, 16, 16, LR_SHARED );
     146        hHDisk   = LoadImageA( inst, "HDISK", IMAGE_ICON, 16, 16, LR_SHARED );
     147        hCDRom   = LoadImageA( inst, "CDROM", IMAGE_ICON, 16, 16, LR_SHARED );
     148        hNet     = LoadImageA( inst, "NETWORK", IMAGE_ICON, 16, 16, LR_SHARED );
    143149#endif
    144150        if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 ||
     
    13181324    else
    13191325        lfs->open = FALSE;
    1320     lfs->lbselchstring = RegisterWindowMessageA(LBSELCHSTRING);
    1321     lfs->fileokstring = RegisterWindowMessageA(FILEOKSTRING);
     1326    lfs->lbselchstring = RegisterWindowMessageA(LBSELCHSTRINGA);
     1327    lfs->fileokstring = RegisterWindowMessageA(FILEOKSTRINGA);
    13221328    switch(type)
    13231329    {
     
    16771683{
    16781684    BOOL  newlook = TRUE; /* FIXME: TWEAK_WineLook */
     1685    COMDLG32_SetCommDlgExtendedError(0);
    16791686
    16801687#ifdef __WIN32OS2__
     
    17121719{
    17131720    BOOL  newlook = TRUE; /* FIXME: TWEAK_WineLook */
     1721    COMDLG32_SetCommDlgExtendedError(0);
    17141722
    17151723#ifdef __WIN32OS2__
     
    17471755{
    17481756    BOOL  newlook = TRUE; /* FIXME: TWEAK_WineLook */
     1757    COMDLG32_SetCommDlgExtendedError(0);
    17491758
    17501759#ifdef __WIN32OS2__
     
    17821791{
    17831792    BOOL  newlook = TRUE; /* FIXME: TWEAK_WineLook */
     1793    COMDLG32_SetCommDlgExtendedError(0);
    17841794
    17851795#ifdef __WIN32OS2__
  • trunk/src/comdlg32/filedlg95.c

    r5141 r5583  
    4545#define MapHModuleSL(a) a
    4646#define MapHModuleLS(a) a
     47#define snprintf  wsnprintfA
    4748#endif
    4849
     
    5455#include "winbase.h"
    5556#include "ntddk.h"
    56 #include "wine/winestring.h"
    57 #include "ldt.h"
     57#include "winnls.h"
    5858#include "heap.h"
    5959#include "commdlg.h"
     
    6262#include "debugtools.h"
    6363#include "cderr.h"
    64 #include "tweak.h"
    65 #include "winnls.h"
    6664#include "shellapi.h"
    6765#include "shlguid.h"
     
    7573(OFN_CREATEPROMPT | OFN_DONTADDTORECENT |\
    7674OFN_ENABLEINCLUDENOTIFY | OFN_ENABLESIZING | OFN_EXTENSIONDIFFERENT |\
    77 OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN | \
     75OFN_NODEREFERENCELINKS | OFN_NOREADONLYRETURN |\
    7876OFN_NOTESTFILECREATE | OFN_OVERWRITEPROMPT /*| OFN_USEMONIKERS*/)
    7977
     
    257255    if (IsHooked(fodInfos))
    258256    {
    259       fodInfos->HookMsg.fileokstring = RegisterWindowMessageA(FILEOKSTRING);
    260       fodInfos->HookMsg.lbselchstring = RegisterWindowMessageA(LBSELCHSTRING);
    261       fodInfos->HookMsg.helpmsgstring = RegisterWindowMessageA(HELPMSGSTRING);
    262       fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRING);
     257      fodInfos->HookMsg.fileokstring = RegisterWindowMessageA(FILEOKSTRINGA);
     258      fodInfos->HookMsg.lbselchstring = RegisterWindowMessageA(LBSELCHSTRINGA);
     259      fodInfos->HookMsg.helpmsgstring = RegisterWindowMessageA(HELPMSGSTRINGA);
     260      fodInfos->HookMsg.sharevistring = RegisterWindowMessageA(SHAREVISTRINGA);
    263261    }
    264262   
     
    368366  if(arg) \
    369367  { \
     368    DWORD _len = WideCharToMultiByte( CP_ACP, 0, arg, -1, NULL, 0, NULL, NULL ); \
    370369    save = arg; \
    371     arg =  MemAlloc(lstrlenW(arg)); \
    372     lstrcpyWtoA((LPSTR)arg, save); \
     370    arg =  MemAlloc(_len); \
     371    WideCharToMultiByte( CP_ACP, 0, save, -1, (LPSTR)arg, _len, NULL, NULL ); \
    373372  }
    374373
     
    391390  if(arg) \
    392391  { \
    393     lstrcpynAtoW(save, (LPCSTR)arg, len); \
     392    MultiByteToWideChar( CP_ACP, 0, (LPCSTR)(arg), -1, (save), (len) ); \
    394393    MemFree(arg); \
    395394    arg = save; \
     
    401400  FileOpenDlgInfos *fodInfos;
    402401  HINSTANCE hInstance;
     402 
     403  /* out arguments */
     404  LPWSTR lpstrFile = NULL;
     405  LPWSTR lpstrFileTitle = NULL;
    403406#ifdef __WIN32OS2__
    404407  LPSTR lpstrSavDir = NULL;
    405408#endif
    406   /* out arguments */
    407   LPWSTR lpstrFile = NULL;
    408   LPWSTR lpstrFileTitle = NULL;
    409409
    410410  /* in/out arguments */
     
    430430  {
    431431    LPCWSTR  s;
    432     LPSTR x, y;
    433     int n;
     432    LPSTR y;
     433    int n, len;
    434434
    435435    lpstrFilter = ofn->lpstrFilter;
     
    438438    s = ofn->lpstrFilter;
    439439   
    440     while (*s) s = s+lstrlenW(s)+1;
     440    while (*s) s = s+strlenW(s)+1;
    441441    s++;
    442442    n = s - ofn->lpstrFilter; /* already divides by 2. ptr magic */
    443     x = y = (LPSTR)MemAlloc(n);
    444     s = (LPWSTR)ofn->lpstrFilter;
    445     while (*s)
    446     {
    447       lstrcpyWtoA(x,s);
    448       x+=strlen(x)+1;
    449       s+=lstrlenW(s)+1;
    450     }
    451     *x=0;
     443    len = WideCharToMultiByte( CP_ACP, 0, ofn->lpstrFilter, n, NULL, 0, NULL, NULL );
     444    y = (LPSTR)MemAlloc(len);
     445    WideCharToMultiByte( CP_ACP, 0, ofn->lpstrFilter, n, y, len, NULL, NULL );
    452446#ifdef __WIN32OS2__
    453447    ofn->lpstrFilter = (LPWSTR)y;
     
    461455  {
    462456    LPWSTR  s;
    463     LPSTR x,y;
    464     int n;
     457    LPSTR y;
     458    int n, len;
    465459
    466460    lpstrCustomFilter = ofn->lpstrCustomFilter;
    467461    /* filter is a list...  title\0ext\0......\0\0 */
    468462    s = ofn->lpstrCustomFilter;
    469     while (*s) s = s+lstrlenW(s)+1;
     463    while (*s) s = s+strlenW(s)+1;
    470464    s++;
    471465    n = s - ofn->lpstrCustomFilter;
    472     x = y = (LPSTR)MemAlloc(n);
    473     s = ofn->lpstrCustomFilter;
    474     while (*s)
    475     {
    476       lstrcpyWtoA(x,s);
    477       x+=strlen(x)+1;
    478       s+=lstrlenW(s)+1;
    479     }
    480     *x=0;
     466    len = WideCharToMultiByte( CP_ACP, 0, ofn->lpstrCustomFilter, n, NULL, 0, NULL, NULL );
     467    y = (LPSTR)MemAlloc(len);
     468    WideCharToMultiByte( CP_ACP, 0, ofn->lpstrCustomFilter, n, y, len, NULL, NULL );
    481469#ifdef __WIN32OS2__
    482470    ofn->lpstrCustomFilter = (LPWSTR)y;
     
    791779
    792780    if(fodInfos->ofnInfos->Flags & OFN_UNICODE)
    793       FIXME("sending OPENFILENAMEA structure. Hook is expecting OPENFILENAMEW!");
     781      FIXME("sending OPENFILENAMEA structure. Hook is expecting OPENFILENAMEW!\n");
    794782
    795783    if(fodInfos->DlgInfos.hwndCustomDlg)
     
    826814        case CDM_GETFILEPATH:
    827815            GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath));
    828             lpstrFileSpec = (LPSTR)COMDLG32_PathFindFileNameA(lpstrPath);
     816            lpstrFileSpec = (LPSTR)PathFindFileNameA(lpstrPath);
    829817            if (lpstrFileSpec==lpstrPath)
    830818            {
    831819                char lpstrCurrentDir[MAX_PATH];
    832820                /* Prepend the current path */
    833                 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrCurrentDir);
     821                SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrCurrentDir);
    834822                if ((LPSTR)lParam!=NULL)
    835                     wsnprintfA((LPSTR)lParam,(int)wParam,"%s\\%s",lpstrCurrentDir,lpstrPath);
     823                    snprintf((LPSTR)lParam,(int)wParam,"%s\\%s",lpstrCurrentDir,lpstrPath);
    836824                reqSize=strlen(lpstrCurrentDir)+1+strlen(lpstrPath)+1;
    837825            }
     
    845833
    846834        case CDM_GETFOLDERPATH:
    847             COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
     835            SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
    848836            if ((LPSTR)lParam!=NULL)
    849837                lstrcpynA((LPSTR)lParam,lpstrPath,(int)wParam);
     
    852840        case CDM_GETSPEC:
    853841            reqSize=GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath));
    854             lpstrFileSpec = (LPSTR)COMDLG32_PathFindFileNameA(lpstrPath);
     842            lpstrFileSpec = (LPSTR)PathFindFileNameA(lpstrPath);
    855843            if ((LPSTR)lParam!=NULL)
    856844                lstrcpynA((LPSTR)lParam, lpstrFileSpec, (int)wParam);
     
    898886         FILEDLG95_FillControls(hwnd, wParam, lParam);
    899887         SendCustomDlgNotificationMessage(hwnd,CDN_SELCHANGE);
     888         SetWindowPos(fodInfos->DlgInfos.hwndCustomDlg, HWND_BOTTOM,
     889                      0,0,0,0, SWP_NOMOVE|SWP_NOSIZE);
    900890         return 0;
    901891       }
     
    10371027  if(fodInfos->ofnInfos->lpstrFile)
    10381028  {
    1039       LPSTR lpstrFile = COMDLG32_PathFindFileNameA(fodInfos->ofnInfos->lpstrFile);
     1029      LPSTR lpstrFile = PathFindFileNameA(fodInfos->ofnInfos->lpstrFile);
    10401030      SetDlgItemTextA(hwnd, IDC_FILENAME, lpstrFile);
    10411031  }
     
    12381228  lpstrFile[0] = '\0';
    12391229 
    1240   COMDLG32_SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec );
     1230  SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec );
    12411231
    12421232  if ( !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE) &&
     
    13511341
    13521342  /* Get the current directory name */
    1353   if (!COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathAndFile))
     1343  if (!SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathAndFile))
    13541344  {
    13551345    /* we are in a special folder, default to desktop */
    1356     if(FAILED(COMDLG32_SHGetFolderPathA(hwnd, CSIDL_DESKTOPDIRECTORY|CSIDL_FLAG_CREATE, NULL, 0, lpstrPathAndFile)))
     1346    if(FAILED(COMDLG32_SHGetFolderPathA(hwnd, CSIDL_DESKTOPDIRECTORY|CSIDL_FLAG_CREATE, 0, 0, lpstrPathAndFile)))
    13571347    {
    13581348      /* last fallback */
     
    13601350    }
    13611351  }
    1362   COMDLG32_PathAddBackslashA(lpstrPathAndFile);
     1352  PathAddBackslashA(lpstrPathAndFile);
    13631353
    13641354  TRACE("current directory=%s\n", lpstrPathAndFile);
    13651355
    13661356  /* if the user specifyed a fully qualified path use it */
    1367   if(COMDLG32_PathIsRelativeA(lpstrFileList))
     1357  if(PathIsRelativeA(lpstrFileList))
    13681358  {
    13691359    strcat(lpstrPathAndFile, lpstrFileList);
     
    13721362  {
    13731363    /* does the path have a drive letter? */
    1374     if (COMDLG32_PathGetDriveNumberA(lpstrFileList) == -1)
     1364    if (PathGetDriveNumberA(lpstrFileList) == -1)
    13751365      strcpy(lpstrPathAndFile+2, lpstrFileList);
    13761366    else
     
    13791369
    13801370  /* resolve "." and ".." */
    1381   COMDLG32_PathCanonicalizeA(lpstrTemp, lpstrPathAndFile );
     1371  PathCanonicalizeA(lpstrTemp, lpstrPathAndFile );
    13821372  strcpy(lpstrPathAndFile, lpstrTemp);
    13831373  TRACE("canon=%s\n", lpstrPathAndFile);
     
    14121402    }
    14131403
    1414     if (FAILED (COMDLG32_SHGetDesktopFolder(&lpsf))) return FALSE;
     1404    if (FAILED (SHGetDesktopFolder(&lpsf))) return FALSE;
    14151405 
    14161406    lpszTemp1 = lpszTemp = lpstrPathAndFile;
     
    14211411      DWORD dwEaten, dwAttributes;
    14221412
    1423       lpszTemp = COMDLG32_PathFindNextComponentA(lpszTemp);
     1413      lpszTemp = PathFindNextComponentA(lpszTemp);
    14241414
    14251415      if (!lpszTemp) break; /* end of path */
    14261416
    14271417      if(*lpszTemp)
    1428         lstrcpynAtoW(lpwstrTemp, lpszTemp1, lpszTemp - lpszTemp1);
     1418      {
     1419          DWORD len = MultiByteToWideChar( CP_ACP, 0, lpszTemp1, lpszTemp - lpszTemp1,
     1420                                           lpwstrTemp, MAX_PATH );
     1421          lpwstrTemp[len] = 0;
     1422      }
    14291423      else
    14301424      {
    1431         lstrcpyAtoW(lpwstrTemp, lpszTemp1);     /* last element */
     1425          MultiByteToWideChar( CP_ACP, 0, lpszTemp1, -1,
     1426                               lpwstrTemp, sizeof(lpwstrTemp)/sizeof(WCHAR) );
    14321427
    14331428        /* if the last element is a wildcard do a search */
     
    14421437      TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_a(lpszTemp), lpsf);
    14431438
    1444       if(lstrlenW(lpwstrTemp)==2) COMDLG32_PathAddBackslashW(lpwstrTemp);
     1439      if(lstrlenW(lpwstrTemp)==2) PathAddBackslashW(lpwstrTemp);
    14451440
    14461441      dwAttributes = SFGAO_FOLDER;
     
    15131508      {
    15141509        int iPos;
    1515         LPSTR lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile);
     1510        LPSTR lpszTemp = PathFindFileNameA(lpstrPathAndFile);
     1511        DWORD len;
    15161512
    15171513        /* replace the current filter */
    15181514        if(fodInfos->ShellInfos.lpstrCurrentFilter)
    15191515          MemFree((LPVOID)fodInfos->ShellInfos.lpstrCurrentFilter);
    1520         fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpszTemp)+1)*sizeof(WCHAR));
    1521         lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, lpszTemp);
     1516        len = MultiByteToWideChar( CP_ACP, 0, lpszTemp, -1, NULL, 0 );
     1517        fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc(len * sizeof(WCHAR));
     1518        MultiByteToWideChar( CP_ACP, 0, lpszTemp, -1,
     1519                             fodInfos->ShellInfos.lpstrCurrentFilter, len );
    15221520
    15231521        /* set the filter cb to the extension when possible */
     
    15541552        if (fodInfos->ofnInfos->lpstrDefExt)
    15551553        {
    1556           if (! *COMDLG32_PathFindExtensionA(lpstrPathAndFile))
     1554          if (! *PathFindExtensionA(lpstrPathAndFile))
    15571555          {
    15581556            strcat(lpstrPathAndFile, ".");
     
    15611559        }
    15621560
    1563         /* Check that size size of the file does not exceed buffer size */
    1564         if(strlen(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile)
     1561        /* Check that the size of the file does not exceed buffer size.
     1562             (Allow for extra \0 if OFN_MULTISELECT is set.) */
     1563        if(strlen(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile -
     1564            ((fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT) ? 1 : 0))
    15651565        {
    15661566          LPSTR lpszTemp;
     
    15681568          /* fill destination buffer */
    15691569          strcpy(fodInfos->ofnInfos->lpstrFile, lpstrPathAndFile);
     1570          if (fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT)
     1571            fodInfos->ofnInfos->lpstrFile[strlen(fodInfos->ofnInfos->lpstrFile)
     1572                + 1] = '\0';
    15701573
    15711574          /* set filename offset */
    1572           lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile);
     1575          lpszTemp = PathFindFileNameA(lpstrPathAndFile);
    15731576          fodInfos->ofnInfos->nFileOffset = lpszTemp - lpstrPathAndFile;
    15741577 
    15751578          /* set extension offset */
    1576           lpszTemp = COMDLG32_PathFindExtensionA(lpstrPathAndFile);
     1579          lpszTemp = PathFindExtensionA(lpstrPathAndFile);
    15771580          fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? lpszTemp - lpstrPathAndFile + 1 : 0;
    15781581   
     
    15801583          if(fodInfos->ofnInfos->lpstrFileTitle)
    15811584          {
    1582             LPSTR lpstrFileTitle = COMDLG32_PathFindFileNameA(lpstrPathAndFile);
     1585            LPSTR lpstrFileTitle = PathFindFileNameA(lpstrPathAndFile);
    15831586            strncpy(fodInfos->ofnInfos->lpstrFileTitle, lpstrFileTitle, fodInfos->ofnInfos->nMaxFileTitle);
    15841587          }
     
    17251728  TRACE("\n");
    17261729
    1727   COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
     1730  SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl);
    17281731  hres = IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidl, SBSP_ABSOLUTE);
    17291732  COMDLG32_SHFree(pidl);
     
    18201823    if(lpstrFilter)
    18211824    {
     1825      DWORD len;
    18221826      _strlwr(lpstrFilter);     /* lowercase */
    1823       fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2);
    1824       lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, lpstrFilter);
     1827      len = MultiByteToWideChar( CP_ACP, 0, lpstrFilter, -1, NULL, 0 );
     1828      fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc( len * sizeof(WCHAR) );
     1829      MultiByteToWideChar( CP_ACP, 0, lpstrFilter, -1,
     1830                           fodInfos->ShellInfos.lpstrCurrentFilter, len );
    18251831    }
    18261832  }
     
    18581864      if((int)lpstrFilter != CB_ERR)
    18591865      {
    1860         fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2);
    1861         lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter,_strlwr(lpstrFilter));
    1862         SendCustomDlgNotificationMessage(hwnd,CDN_TYPECHANGE);
     1866          DWORD len;
     1867          _strlwr(lpstrFilter); /* lowercase */
     1868          len = MultiByteToWideChar( CP_ACP, 0, lpstrFilter, -1, NULL, 0 );
     1869          fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc( len * sizeof(WCHAR) );
     1870          MultiByteToWideChar( CP_ACP, 0, lpstrFilter, -1,
     1871                               fodInfos->ShellInfos.lpstrCurrentFilter, len );
     1872          SendCustomDlgNotificationMessage(hwnd,CDN_TYPECHANGE);
    18631873      }
    18641874
     
    19431953
    19441954  /* Initialise data of Desktop folder */
    1945   COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
     1955  SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp);
    19461956  FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND);
    19471957  COMDLG32_SHFree(pidlTmp);
    19481958
    1949   COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DRIVES,&pidlDrives);
    1950 
    1951   COMDLG32_SHGetDesktopFolder(&psfRoot);
     1959  SHGetSpecialFolderLocation(0,CSIDL_DRIVES,&pidlDrives);
     1960
     1961  SHGetDesktopFolder(&psfRoot);
    19521962
    19531963  if (psfRoot)
     
    20242034  if(pDIStruct->itemID == liInfos->uSelectedItem)
    20252035  {
    2026     ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
     2036    ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
    20272037                                               0,   
    20282038                                               &sfi,   
     
    20342044  else
    20352045  {
    2036     ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
     2046    ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
    20372047                                                  0,
    20382048                                                  &sfi,
     
    20612071  {
    20622072    iIndentation = 0;
    2063     ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
     2073    ilItemImage = (HIMAGELIST) SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem,
    20642074                                                0,
    20652075                                                &sfi,
     
    20912101 
    20922102  /* Draw the icon from the image list */
    2093   COMDLG32_ImageList_Draw(ilItemImage,
     2103  ImageList_Draw(ilItemImage,
    20942104                 sfi.iIcon,
    20952105                 pDIStruct->hDC, 
     
    21822192 
    21832193  sfi.dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM;
    2184   COMDLG32_SHGetFileInfoA((LPSTR)pidl,
     2194  SHGetFileInfoA((LPSTR)pidl,
    21852195                  0,
    21862196                  &sfi,
     
    26722682  {
    26732683    HRESULT hRes;
    2674     COMDLG32_SHGetDesktopFolder(&lpsf);
     2684    SHGetDesktopFolder(&lpsf);
    26752685    hRes = GetName(lpsf,pidl,dwFlags,lpstrFileName);
    26762686    IShellFolder_Release(lpsf);
     
    26982708  TRACE("%p\n", pidlAbs);
    26992709
    2700   if(SUCCEEDED(COMDLG32_SHGetDesktopFolder(&psfParent)))
     2710  if(SUCCEEDED(SHGetDesktopFolder(&psfParent)))
    27012711  {
    27022712    psf = psfParent;
     
    27362746 *
    27372747 * returns the pidl of the file name relative to folder
    2738  * NULL if an error occured
     2748 * NULL if an error occurred
    27392749 */
    27402750LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName)
     
    27462756  TRACE("sf=%p file=%s\n", lpsf, lpcstrFileName);
    27472757
    2748 #ifdef __WIN32OS2__
    2749   if(!lpcstrFileName || *lpcstrFileName == 0) return NULL;
    2750 #else
    27512758  if(!lpcstrFileName) return NULL;
    2752 #endif
     2759  if(!*lpcstrFileName) return NULL;
    27532760
    27542761  MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpcstrFileName,-1,(LPWSTR)lpwstrDirName,MAX_PATH); 
     
    27562763  if(!lpsf)
    27572764  {
    2758     COMDLG32_SHGetDesktopFolder(&lpsf);
     2765    SHGetDesktopFolder(&lpsf);
    27592766    pidl = GetPidlFromName(lpsf, lpcstrFileName);
    27602767    IShellFolder_Release(lpsf);
  • trunk/src/comdlg32/filedlgbrowser.c

    r4561 r5583  
    55 */
    66
     7#include <stdio.h>
     8#include <string.h>
     9
     10#include "windef.h"
     11#include "winbase.h"
     12#include "winnls.h"
     13#include "wingdi.h"
     14#include "winuser.h"
     15#include "heap.h"
     16#include "debugtools.h"
     17
     18#include "shlwapi.h"
     19#include "filedlgbrowser.h"
     20#include "cdlg.h"
     21#include "shlguid.h"
     22#include "wine/obj_serviceprovider.h"
     23
    724#ifdef __WIN32OS2__
    8 #include <windef.h>
    9 #include <winbase.h>
    10 #include <wingdi.h>
    11 #include <winuser.h>
    1225#include <heapstring.h>
    1326#include <misc.h>
    14 
    1527#endif
    16 
    17 #include <stdio.h>
    18 #include "unknwn.h"
    19 #include "filedlgbrowser.h"
    20 #include "windef.h"
    21 #include "wingdi.h"
    22 #include "winuser.h"
    23 #include "wine/winestring.h"
    24 #include "heap.h"
    25 #include "shlguid.h"
    26 #include "wine/obj_dataobject.h"
    27 #include "debugtools.h"
    28 #include "cdlg.h"
    29 
    30 #define INITGUID
    31 #include "initguid.h"
    32 #include "wine/obj_serviceprovider.h"
    3328
    3429DEFAULT_DEBUG_CHANNEL(commdlg);
     
    8479 *   Helper functions
    8580 */
     81
     82static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
     83{
     84    char lpstrPath[MAX_PATH];
     85    SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
     86    SetCurrentDirectoryA(lpstrPath);
     87    TRACE("new current folder %s\n", lpstrPath);
     88}
    8689
    8790/* copied from shell32 to avoid linking to it */
     
    98101
    99102          case STRRET_CSTRA:
    100             lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
     103            if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, (LPWSTR)dest, len ))
     104                ((LPWSTR)dest)[len-1] = 0;
    101105            break;
    102106
     
    104108            if (pidl)
    105109            {
    106               lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
     110                if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
     111                                                 -1, (LPWSTR)dest, len ))
     112                    ((LPWSTR)dest)[len-1] = 0;
    107113            }
    108114            break;
     
    111117            FIXME("unknown type!\n");
    112118            if (len)
    113             { *(LPSTR)dest = '\0';
     119            { *(LPWSTR)dest = '\0';
    114120            }
    115121            return(FALSE);
     
    140146    sb->lpVtblCommDlgBrowser = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
    141147    sb->lpVtblServiceProvider = &IShellBrowserImpl_IServiceProvider_Vtbl;
    142     COMDLG32_SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
     148    SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
    143149                               &fodInfos->ShellInfos.pidlAbsCurrent);
    144150
     
    157163    ICOM_THIS(IShellBrowserImpl, iface);
    158164
    159 #ifndef __WIN32OS2__
    160165    TRACE("(%p)\n\t%s\n", This, debugstr_guid(riid));
    161 #endif
    162166
    163167    *ppvObj = NULL;
     
    376380    COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
    377381    fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
     382
     383    COMDLG32_UpdateCurrentDir(fodInfos);
    378384
    379385    /* Create the window */
     
    791797      if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
    792798      {
    793           if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
     799          if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
    794800          return S_OK;
    795801      }
     
    905911    _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
    906912
    907 #ifndef __WIN32OS2__
    908913    FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
    909 #endif
    910914
    911915    *ppv = NULL;
  • trunk/src/comdlg32/fontdlg.c

    r4514 r5583  
    884884                  break;
    885885       
    886         case psh15:i=RegisterWindowMessageA( HELPMSGSTRING );
     886        case psh15:i=RegisterWindowMessageA( HELPMSGSTRINGA );
    887887                  if (lpcf->hwndOwner)
    888888                    SendMessageA(lpcf->hwndOwner, i, 0, (LPARAM)GetWindowLongA(hDlg, DWL_USER));
  • trunk/src/comdlg32/makefile

    r5579 r5583  
    1 # $Id: makefile,v 1.24 2001-04-24 19:44:26 sandervl Exp $
     1# $Id: makefile,v 1.25 2001-04-24 20:37:25 sandervl Exp $
    22
    33#
     
    1717# Overrides.
    1818#
     19!if "$(CCENV)" == "VAC36"
    1920CDEFINES    = $(CDEFINES) -DNONAMELESSUNION
     21!endif
    2022
    2123#
Note: See TracChangeset for help on using the changeset viewer.