Fix default extension behavior with GetOpenFileName.
This commit is contained in:
parent
add0b5d28f
commit
2dbf9ea34c
|
@ -1528,8 +1528,15 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
/* only add "." in case a default extension does exist */
|
/* only add "." in case a default extension does exist */
|
||||||
if (*fodInfos->ofnInfos->lpstrDefExt != '\0')
|
if (*fodInfos->ofnInfos->lpstrDefExt != '\0')
|
||||||
{
|
{
|
||||||
|
int PathLength;
|
||||||
|
PathLength = strlen(lpstrPathAndFile);
|
||||||
|
|
||||||
strcat(lpstrPathAndFile, ".");
|
strcat(lpstrPathAndFile, ".");
|
||||||
strcat(lpstrPathAndFile, fodInfos->ofnInfos->lpstrDefExt);
|
strcat(lpstrPathAndFile, fodInfos->ofnInfos->lpstrDefExt);
|
||||||
|
|
||||||
|
/* if file does not exist try without extension */
|
||||||
|
if (!PathFileExistsA(lpstrPathAndFile))
|
||||||
|
lpstrPathAndFile[PathLength] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue