Windows.Storage.Pickers Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The Windows.Storage.Pickers namespace contains classes that create file and folder picker dialogs. Use these classes to let users browse, select files to open, and choose where to save files with specific names and extensions.
Classes
| FileExtensionVector |
Represents a random-access collection of file name extensions. |
| FileOpenPicker |
Represents a UI element that lets the user choose and open files. In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow. |
| FilePickerFileTypesOrderedMap |
Represents a collection of display names mapped to the associated file types (extensions). Each element in this collection maps a display name to a corresponding collection of file name extensions. The key is a single string, the value is a list/vector of strings representing one or more extension choices. |
| FilePickerSelectedFilesArray |
Represents a collection of storage files that the user has selected by using a file picker. |
| FileSavePicker |
Represents a file picker that lets the user choose the file name, extension, and storage location for a file. In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow. |
| FolderPicker |
Represents a UI element that lets the user choose folders. In a desktop app, before using an instance of this class in a way that displays UI, you'll need to associate the object with its owner's window handle. For more info, and code examples, see Display WinRT UI objects that depend on CoreWindow. |
Enums
| PickerLocationId |
Identifies the storage location that the file picker presents to the user. |
| PickerViewMode |
Indicates the view mode that the file picker is using to present items. |
Examples
Tip
For more info, design guidance, and code examples, see Open files and folders with a picker.
The WinUI 3 Gallery app includes interactive examples of most WinUI 3 controls, features, and functionality. Get the app from the Microsoft Store or get the source code on GitHub
Remarks
The file and folder picker APIs (Windows.Storage.Pickers) in the Windows SDK don't work when apps run as administrator (elevated mode). To address this gap, the Microsoft.Windows.Storage.Pickers APIs are added to the Windows App SDK and support file and folder selection in elevated mode. They are designed for desktop apps and use a WindowId property to link the picker to its host window.