You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: windows.storage.pickers/fileopenpicker.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,9 @@ In a desktop app, before using an instance of this class in a way that displays
19
19
20
20
To get started accessing files and folders file picker, see [Quickstart: Accessing files with File Pickers](/windows/uwp/files/quickstart-using-file-and-folder-pickers).
21
21
22
+
> [!NOTE]
23
+
> To use a file open picker in a WinUI app (or other desktop app), see the [FileOpenPicker class](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker) documentation for the Windows App SDK.
24
+
22
25
For information about how to use this API outside of UWP apps, see [Call interop APIs from a .NET app](/windows/apps/desktop/modernize/winrt-com-interop-csharp).
Copy file name to clipboardExpand all lines: windows.storage.pickers/filesavepicker.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,18 +18,26 @@ In a desktop app, before using an instance of this class in a way that displays
18
18
## -remarks
19
19
20
20
> [!IMPORTANT]
21
-
> You must use the [FileTypeChoices property](filesavepicker_filetypechoices.md) property to specify one or more file types before you call the PickSaveFileAsync method, or the picker will thrown an exception.
21
+
> You must use the [FileTypeChoices property](filesavepicker_filetypechoices.md) property to specify one or more file types before you call the **PickSaveFileAsync** method, or the picker will thrown an exception.
22
22
23
23
To learn how to save files through the file picker, see [How to save files through file pickers](/windows/uwp/files/quickstart-save-a-file-with-a-picker).
24
24
25
+
> [!NOTE]
26
+
> To use a file save picker in a WinUI app, see the [FileSavePicker class](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker) documentation for the Windows App SDK.
27
+
25
28
To get started accessing files and folders file picker, see [Files, folders, and libraries ](/windows/uwp/files/index).
26
29
27
30
> [!WARNING]
28
31
> If you try to show the file picker while your app is snapped, the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped or by unsnapping it before you call the file picker. The following code examples and the [File picker sample](https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/FilePicker) show you how.
29
32
30
33
### In a desktop app that requires elevation
31
34
32
-
In a desktop app (which includes WinUI 3 apps), you can use **FileSavePicker** (and other types from **Windows.Storage.Pickers**). But if the desktop app requires elevation to run, then you'll need a different approach (that's because these APIs aren't designed to be used in an elevated app). The code snippet below illustrates how you can use the [C#/Win32 P/Invoke Source Generator](https://github.com/microsoft/CsWin32) (CsWin32) to call the Win32 picking APIs instead. To learn how to use CsWin32, follow that link for the documentation.
35
+
> [!IMPORTANT]
36
+
> 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](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers) APIs are added to the Windows App SDK and support file and folder selection in elevated mode. It's designed for desktop apps and uses a WindowId property to link the picker to its host window.
37
+
>
38
+
> If you must use the Windows.Storage.Pickers APIs in an elevated desktop app, you can follow example below.
39
+
40
+
You can use **FileSavePicker** (and other types from **Windows.Storage.Pickers**) in a desktop app. However, if the desktop app requires elevation to run, then you'll need a different approach (that's because these APIs aren't designed to be used in an elevated app). The code snippet below illustrates how you can use the [C#/Win32 P/Invoke Source Generator](https://github.com/microsoft/CsWin32) (CsWin32) to call the Win32 picking APIs instead. To learn how to use CsWin32, follow that link for the documentation.
Copy file name to clipboardExpand all lines: windows.storage.pickers/folderpicker.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,9 @@ In a desktop app, before using an instance of this class in a way that displays
20
20
21
21
To get started accessing files and folders with a picker, see [Open files and folders with a picker](/windows/uwp/files/quickstart-using-file-and-folder-pickers).
22
22
23
+
> [!NOTE]
24
+
> To use a folder picker in a WinUI app (or other desktop app), see the [FolderPicker class](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.folderpicker) documentation for the Windows App SDK.
Copy file name to clipboardExpand all lines: windows.storage.pickers/windows_storage_pickers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
8
8
## -description
9
9
10
-
Provides classes for creating and managing user interface (UI) elements that let the user browse files, choose files to open, and to choose the name, extension, and location when storing files.
10
+
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.
0 commit comments