ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/VTBFileUtil2/ScanUtility.cxx
(Generate patch)

Comparing trunk/VTBFileUtil2/ScanUtility.cxx (file contents):
Revision 289 by douglas, 2003-09-03T15:58:38-07:00 vs.
Revision 290 by douglas, 2003-09-04T18:57:00-07:00

# Line 2 | Line 2
2   //
3   // Douglas Thrift
4   //
5 < // $Id: ScanUtility.cxx,v 1.14 2003/09/03 22:58:38 douglas Exp $
5 > // $Id: ScanUtility.cxx,v 1.15 2003/09/05 01:57:00 douglas Exp $
6  
7   #include "ScanUtility.h"
8  
# Line 381 | Line 381 | void ScanUtility::populate(HWND parent)
381  
382                          FindClose(finder);
383                  }
384                else
385                {
386                        error(parent);
387                }
384  
385                  if (scans.empty())
386                  {
# Line 466 | Line 462 | int ScanUtility::browse(HWND dialog, UIN
462                  SendMessage(dialog, BFFM_SETOKTEXT, 0,
463                          LPARAM(toWide("&Select").c_str()));
464                  SendMessage(dialog, BFFM_SETEXPANDED, FALSE, CSIDL_DRIVES);
465 <                SendMessage(dialog, BFFM_SETSELECTION, TRUE, LPARAM(HIWORD(d) ?
466 <                        data->scanDir.c_str() : data->saveDir.c_str()));
465 >
466 >                if ((HIWORD(d) ? data->scanDir : data->saveDir) != "")
467 >                {
468 >                        IShellFolder* desktop;
469 >                        LPWSTR path = new WCHAR[(HIWORD(d) ? data->scanDir.length() :
470 >                                data->saveDir.length()) + 1];
471 >                        LPITEMIDLIST id;
472 >
473 >                        wsprintfW(path, toWide(HIWORD(d) ? data->scanDir :
474 >                                data->saveDir).c_str());
475 >
476 >                        if (debug) cerr << "path = " << toAnsi(path) << "\n";
477 >
478 >                        SHGetDesktopFolder(&desktop);
479 >                        desktop->ParseDisplayName(dialog, NULL, path, NULL, &id, NULL);
480 >
481 >                        if (id != NULL)
482 >                        {
483 >                                SendMessage(dialog, BFFM_SETSELECTION, FALSE, LPARAM(id));
484 >
485 >                                LPMALLOC destruct;
486 >
487 >                                SHGetMalloc(&destruct);
488 >                                destruct->Free(id);
489 >                                destruct->Release();
490 >                        }
491 >
492 >                        desktop->Release();
493 >                }
494                  break;
495          case BFFM_SELCHANGED:
496                  {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines