GetSaveFileName ne marche pas bien
Salut.
j'ai un souci avec la méthode GetSaveFileName.
Lorsque l'option windows "Masquer les extensions des fichiers dont le type est connu" est sélectionnée et que le nom du fichier contient un point (.), le nom du fichier est tronqué.
Example :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(OPENFILENAMEW);
ofn.hwndOwner = (HWND)olhParentHWnd;
ofn.lpstrFilter = "(Doc files)\0*.pkp\0\0";
ofn.nFilterIndex = 1;
ofn.lpstrDefExt = ".pkp";
ofn.lpstrFile = "MyDoc.prefered";
ofn.nMaxFile = _MAX_PATH;
ofn.lpstrTitle = "Save pkp file"
ofn.Flags = OFN_NOREADONLYRETURN | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER | OFN_NOVALIDATE;
ofn.Flags |= OFN_ENABLEHOOK;
ofn.Flags |= OFN_ENABLESIZING;
ofn.lpfnHook = (LPOFNHOOKPROC)CMySavepkpFile::CustomSaveDlgHookProc;
ofn.lpstrInitialDir = "C:\\Documents and Settings\\Administrator\\My Documents";
GetSaveFileName(&ofn); |
Malheureusement, le nom de fichier affiché par GetSaveFileName est "Mydoc" au lieu de "MyDoc.prefered".
Quelqu'un aurait'-il une idée ?
Merci