Problem with GetSaveFilename and auto completion

  • Thread starter Thread starter Achim Hammes
  • Start date Start date
A

Achim Hammes

I'm using GetSaveFileName with filters for graphic file formats.
Wenn teh user enters the first charachters of the filename in file name edit
control a lookup autocomplete list appeares.
In this List every file is shown thet starts with this charachters.
That would be ok so far.
But unfortunatly files with unwanted extensions (not in filter) appears
also. so if a bad user selects on of them we overwrite wrong filetypes
How can we turn off the autocolete or is there another workarround

regards
achim
 
Don't know if you can control the autocomplete listings. But you should be able to validate the file name typed by the user.

"If the user specifies a file name and clicks the OK button and the function is successful, the return value is nonzero. The buffer pointed to by the lpstrFile member of the OPENFILENAME structure contains the full path and file name specified by the user."

http://msdn2.microsoft.com/en-us/library/ms646928.aspx

You can check the file extension from the full path programatically and permit the "Save" operation if the extension is valid.

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows Shell/User]
Windows® Troubleshooting http://www.winhelponline.com


I'm using GetSaveFileName with filters for graphic file formats.
Wenn teh user enters the first charachters of the filename in file name edit
control a lookup autocomplete list appeares.
In this List every file is shown thet starts with this charachters.
That would be ok so far.
But unfortunatly files with unwanted extensions (not in filter) appears
also. so if a bad user selects on of them we overwrite wrong filetypes
How can we turn off the autocolete or is there another workarround

regards
achim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top