Fix default extension behavior with GetOpenFileName.

oldstable
Mehmet Yasar 2002-03-26 19:47:40 +00:00 committed by Alexandre Julliard
parent add0b5d28f
commit 2dbf9ea34c
1 changed files with 7 additions and 0 deletions

View File

@ -1528,8 +1528,15 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
/* only add "." in case a default extension does exist */
if (*fodInfos->ofnInfos->lpstrDefExt != '\0')
{
int PathLength;
PathLength = strlen(lpstrPathAndFile);
strcat(lpstrPathAndFile, ".");
strcat(lpstrPathAndFile, fodInfos->ofnInfos->lpstrDefExt);
/* if file does not exist try without extension */
if (!PathFileExistsA(lpstrPathAndFile))
lpstrPathAndFile[PathLength] = '\0';
}
}
}