Using IFileOpenDialog in C#
-
Does anyone know how to use these new Vista COM objects in a C# project. I am talking about the IFileDialog objects/classes/libraries/idl's and all that inherit from it. Thanks, Adam
The best place to point you is probably the Common Item Dialogs[^] documentation. I would expect Microsoft to change
OpenFileDialog
(etc) to eventually wrap these new interfaces, for whatever new functionality is available (if they haven't already in v3.5). What specifically does this do that you don't get fromOpenFileDialog
?DoEvents: Generating unexpected recursion since 1991
-
Does anyone know how to use these new Vista COM objects in a C# project. I am talking about the IFileDialog objects/classes/libraries/idl's and all that inherit from it. Thanks, Adam
Follow this step: 1.You can download Windows® API Code Pack for Microsoft® .NET Framework 2.See how the "\Windows API Code Pack 1.1\source\WindowsAPICodePack\Shell\CommonFileDialogs\CommonFileDialog.cs" make use of IFileDialogCustomize from com. 3.If you want to add a stuff to the "Open" dropdownlist, you can write code below
customize.EnableOpenDropDown(0);
customize.AddControlItem(0, 0, "Open as XXX");
customize.AddControlItem(0, 1, "Open in YYY");
Note: 0 is the Open Button ID After user selected, you can get the selectedIndex through
this.customize.GetSelectedControlItem(0, out openindex);
Note again: 0 is the Open Button ID And then you can do something imply with filename and this openindex. Wish to help you~