notepad: We pass OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST to GetOpenFileName, so there is no point in testing file existence.
This commit is contained in:
parent
ee747f3d70
commit
4ea5fce083
@ -217,7 +217,7 @@ void DoOpenFile(LPCWSTR szFileName)
|
|||||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if(hFile == INVALID_HANDLE_VALUE)
|
if(hFile == INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
ShowLastError();
|
AlertFileNotFound(szFileName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,12 +318,8 @@ VOID DIALOG_FileOpen(VOID)
|
|||||||
openfilename.lpstrDefExt = szDefaultExt;
|
openfilename.lpstrDefExt = szDefaultExt;
|
||||||
|
|
||||||
|
|
||||||
if (GetOpenFileName(&openfilename)) {
|
if (GetOpenFileName(&openfilename))
|
||||||
if (FileExists(openfilename.lpstrFile))
|
DoOpenFile(openfilename.lpstrFile);
|
||||||
DoOpenFile(openfilename.lpstrFile);
|
|
||||||
else
|
|
||||||
AlertFileNotFound(openfilename.lpstrFile);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user