views:

163

answers:

1

I'm trying to let the user select the file encoding when they load or save a file in C# and VS2008. Notepad's dialog boxes have an encoding drop down option at the bottom.

There is a way to do it as described in here: http://www.codeproject.com/KB/cs/getsavefilename.aspx.

However, I'm wondering if there is any easier way to do this. Windows must have this dialog built-in somewhere, isn't it?

+1  A: 

The dialog that is built in is the standard File Open dialog provided by the Win32 API. This dialog allows customization through the use of hooks, as described in the Code Project article you reference.

The process described in the article is the only way to do this and is what Notepad and Visual Studio are doing if they are really using the Win32 file open dialog and not one of their own making.

Scott Dorman
Thank you Scott for answering. I was hoping that the encoding option is actually built-in and there is a hidden feature somewhere in the .NET framework or Windows API that can turn on that option.That would have been nice, isn't it?In the mean time, the method described in the CodeProject article would serve my purpose well.
MaDDoG