/[winpt]/trunk/Src/wptW32API.cpp
ViewVC logotype

Diff of /trunk/Src/wptW32API.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by twoaday, Fri Sep 30 10:10:16 2005 UTC revision 25 by twoaday, Wed Oct 12 10:04:26 2005 UTC
# Line 71  set_menu_state (HMENU menu, int m_uid, i Line 71  set_menu_state (HMENU menu, int m_uid, i
71  } /* set_menu_state */  } /* set_menu_state */
72    
73    
74    
75  /* Use the common dialog to request a file from the user.  /* Use the common dialog to request a file from the user.
76     id can be either FILE_OPEN or FILE_SAVE.     id can be either FILE_OPEN or FILE_SAVE.
77     The return value is the file name or NULL if cancel was chosen. */     The return value is the file name or NULL if cancel was chosen. */
# Line 108  get_filename_dlg (HWND hwnd, int id, con Line 109  get_filename_dlg (HWND hwnd, int id, con
109      return NULL;      return NULL;
110  }  }
111    
112    const char*
113    get_filesave_dlg (HWND hwnd, const char *title,
114                      const char *filter, const char *name)
115    {
116        return get_filename_dlg (hwnd, FILE_SAVE, title, filter, name);
117    }
118    
119    const char *
120    get_fileopen_dlg (HWND hwnd, const char *title, const char *filter,
121                      const char *name)
122    {
123        return get_filename_dlg (hwnd, FILE_OPEN, title, filter, name);
124    }
125    
126    
127  /* Use the common dialog to allow the user to select a folder.  /* Use the common dialog to allow the user to select a folder.
128     The return value is either the folder path or NULL if cancel was chosen. */     The return value is either the folder path or NULL if cancel was chosen. */
129  const char*  const char*
# Line 260  make_filename (const char *path, const c Line 276  make_filename (const char *path, const c
276  /* return 0 if it exists, otherwise >0. */  /* return 0 if it exists, otherwise >0. */
277  int  int
278  file_exist_check (const char * fname)  file_exist_check (const char * fname)
279  {        {
280      HANDLE fh;        struct stat st;
281        if (stat (fname, &st) == -1)
     fh = CreateFile( fname, GENERIC_READ, FILE_SHARE_READ,  
                      NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );  
     if( fh == INVALID_HANDLE_VALUE )  
282          return WPTERR_FILE_EXIST;          return WPTERR_FILE_EXIST;
     CloseHandle( fh );  
283      return 0;      return 0;
284  }  }
285    

Legend:
Removed from v.23  
changed lines
  Added in v.25

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26