Changeset 24


Ignore:
Timestamp:
May 14, 2006, 1:56:24 PM (15 years ago)
Author:
Eugene Romanenko
Message:

open file: remember last used directory

Location:
trunk/Lucide/SOURCE/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/lucide.cpp

    r18 r24  
    2525const char *appName = "Lucide";
    2626const char *fwp = "FrameWindowPos";
     27const char *lvd = "LastViewedDir";
    2728
    2829
     
    315316    fd->cbSize = sizeof( FILEDLG );
    316317    fd->fl = FDS_CENTER | FDS_OPEN_DIALOG;
    317     strcpy( fd->szFullFile, pluginMan->getExtsMask().c_str() );
     318    PrfQueryProfileString( HINI_USERPROFILE, appName, lvd, "",
     319                           fd->szFullFile, sizeof( fd->szFullFile ) );
     320    strcat( fd->szFullFile, pluginMan->getExtsMask().c_str() );
    318321    WinFileDlg( HWND_DESKTOP, hWndFrame, fd );
    319     if ( fd->lReturn == DID_OK ) {
     322    if ( fd->lReturn == DID_OK )
     323    {
     324        char drv[ _MAX_DRIVE ] = "";
     325        char dir[ _MAX_PATH ] = "";
     326        char buf[ _MAX_PATH ] = "";
     327        _splitpath( fd->szFullFile, drv, dir, NULL, NULL );
     328        _makepath( buf, drv, dir, NULL, NULL );
     329        PrfWriteProfileString( HINI_USERPROFILE, appName, lvd, buf );
     330
    320331        loadDocument( fd->szFullFile );
    321332    }
  • trunk/Lucide/SOURCE/gui/luutils.cpp

    r2 r24  
    406406    return s;
    407407}
     408
Note: See TracChangeset for help on using the changeset viewer.