git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@871 a31d4220-a93d-0410-bf67-fe4944624d44

This commit is contained in:
squall-leonhart 2009-03-24 05:27:55 +00:00
parent ad404dd582
commit 9152c67444
2 changed files with 11 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#include "MainWnd.h"
#include <winsock.h>
#include <shlwapi.h>
#include "FileDlg.h"
#include "Reg.h"
@ -48,6 +49,12 @@ MainWnd::~MainWnd()
{
}
bool MainWnd::fileExists( LPCTSTR lpFileName )
{
// check if file exists
return GetFileAttributes( lpFileName ) != INVALID_FILE_ATTRIBUTES;
}
BEGIN_MESSAGE_MAP(MainWnd, CWnd)
//{{AFX_MSG_MAP(MainWnd)
@ -1154,9 +1161,7 @@ void MainWnd::screenCapture(int captureNumber)
captureNumber,
ext);
// check if file exists
DWORD dwAttr = GetFileAttributes( buffer );
if( dwAttr != INVALID_FILE_ATTRIBUTES ) {
if( fileExists( buffer ) ) {
// screenshot file already exists
screenCapture(++captureNumber);
// this will recursively use the first non-existent screenshot number

View File

@ -30,6 +30,9 @@ public:
void winSaveCheatList(const char *name);
void winSaveCheatListDefault();
private:
bool fileExists( LPCTSTR lpFileName );
DECLARE_MESSAGE_MAP()