|
1 | 1 | using System; |
2 | 2 | using System.Runtime.InteropServices; |
3 | | -using System.Runtime.Versioning; |
4 | 3 | using Windows.Win32.Foundation; |
5 | 4 | using Windows.Win32.UI.Shell.Common; |
6 | 5 |
|
7 | | -namespace Windows.Win32.UI.Shell; |
| 6 | +#if NET6_0_OR_GREATER |
| 7 | +using System.Runtime.Versioning; |
| 8 | +#endif |
8 | 9 |
|
9 | | -[Guid("D57C7288-D4AD-4768-BE02-9D969532D960"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComImport()] |
10 | | -[SupportedOSPlatform("windows6.0.6000")] |
11 | | -internal interface IFileOpenDialog : IFileDialog |
| 10 | +namespace Windows.Win32.UI.Shell |
12 | 11 | { |
13 | | - new HRESULT Show(HWND hwndOwner); |
| 12 | + [Guid("D57C7288-D4AD-4768-BE02-9D969532D960"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComImport()] |
| 13 | +#if NET6_0_OR_GREATER |
| 14 | + [SupportedOSPlatform("windows6.0.6000")] |
| 15 | +#endif |
| 16 | + internal interface IFileOpenDialog : IFileDialog |
| 17 | + { |
| 18 | + new HRESULT Show(HWND hwndOwner); |
14 | 19 |
|
15 | | - unsafe new HRESULT SetFileTypes(uint cFileTypes, COMDLG_FILTERSPEC* rgFilterSpec); |
| 20 | + unsafe new HRESULT SetFileTypes(uint cFileTypes, COMDLG_FILTERSPEC* rgFilterSpec); |
16 | 21 |
|
17 | | - new HRESULT SetFileTypeIndex(uint iFileType); |
| 22 | + new HRESULT SetFileTypeIndex(uint iFileType); |
18 | 23 |
|
19 | | - new HRESULT GetFileTypeIndex(out uint piFileType); |
| 24 | + new HRESULT GetFileTypeIndex(out uint piFileType); |
20 | 25 |
|
21 | | - new HRESULT Advise(IFileDialogEvents pfde, out uint pdwCookie); |
| 26 | + new HRESULT Advise(IFileDialogEvents pfde, out uint pdwCookie); |
22 | 27 |
|
23 | | - new HRESULT Unadvise(uint dwCookie); |
| 28 | + new HRESULT Unadvise(uint dwCookie); |
24 | 29 |
|
25 | | - new HRESULT SetOptions(FILEOPENDIALOGOPTIONS fos); |
| 30 | + new HRESULT SetOptions(FILEOPENDIALOGOPTIONS fos); |
26 | 31 |
|
27 | | - unsafe new HRESULT GetOptions(FILEOPENDIALOGOPTIONS* pfos); |
| 32 | + unsafe new HRESULT GetOptions(FILEOPENDIALOGOPTIONS* pfos); |
28 | 33 |
|
29 | | - new HRESULT SetDefaultFolder(IShellItem psi); |
| 34 | + new HRESULT SetDefaultFolder(IShellItem psi); |
30 | 35 |
|
31 | | - new HRESULT SetFolder(IShellItem psi); |
| 36 | + new HRESULT SetFolder(IShellItem psi); |
32 | 37 |
|
33 | | - new HRESULT GetFolder(out IShellItem ppsi); |
| 38 | + new HRESULT GetFolder(out IShellItem ppsi); |
34 | 39 |
|
35 | | - new HRESULT GetCurrentSelection(out IShellItem ppsi); |
| 40 | + new HRESULT GetCurrentSelection(out IShellItem ppsi); |
36 | 41 |
|
37 | | - new HRESULT SetFileName(PCWSTR pszName); |
| 42 | + new HRESULT SetFileName(PCWSTR pszName); |
38 | 43 |
|
39 | | - unsafe new HRESULT GetFileName(PWSTR* pszName); |
| 44 | + unsafe new HRESULT GetFileName(PWSTR* pszName); |
40 | 45 |
|
41 | | - new HRESULT SetTitle(PCWSTR pszTitle); |
| 46 | + new HRESULT SetTitle(PCWSTR pszTitle); |
42 | 47 |
|
43 | | - new HRESULT SetOkButtonLabel(PCWSTR pszText); |
| 48 | + new HRESULT SetOkButtonLabel(PCWSTR pszText); |
44 | 49 |
|
45 | | - new HRESULT SetFileNameLabel(PCWSTR pszLabel); |
| 50 | + new HRESULT SetFileNameLabel(PCWSTR pszLabel); |
46 | 51 |
|
47 | | - new HRESULT GetResult(out IShellItem ppsi); |
| 52 | + new HRESULT GetResult(out IShellItem ppsi); |
48 | 53 |
|
49 | | - new HRESULT AddPlace(IShellItem psi, FDAP fdap); |
| 54 | + new HRESULT AddPlace(IShellItem psi, FDAP fdap); |
50 | 55 |
|
51 | | - new HRESULT SetDefaultExtension(PCWSTR pszDefaultExtension); |
| 56 | + new HRESULT SetDefaultExtension(PCWSTR pszDefaultExtension); |
52 | 57 |
|
53 | | - new HRESULT Close(HRESULT hr); |
| 58 | + new HRESULT Close(HRESULT hr); |
54 | 59 |
|
55 | | - unsafe new HRESULT SetClientGuid(Guid* guid); |
| 60 | + unsafe new HRESULT SetClientGuid(Guid* guid); |
56 | 61 |
|
57 | | - new HRESULT ClearClientData(); |
| 62 | + new HRESULT ClearClientData(); |
58 | 63 |
|
59 | | - new HRESULT SetFilter(IShellItemFilter pFilter); |
| 64 | + new HRESULT SetFilter(IShellItemFilter pFilter); |
60 | 65 |
|
61 | | - /// <summary>Gets the user's choices in a dialog that allows multiple selection.</summary> |
62 | | - /// <param name="ppenum"> |
63 | | - /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a>**</b> The address of a pointer to an <b>IShellItemArray</b> through which the items selected in the dialog can be accessed.</para> |
64 | | - /// <para><see href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getresults#parameters">Read more on docs.microsoft.com</see>.</para> |
65 | | - /// </param> |
66 | | - /// <returns> |
67 | | - /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> |
68 | | - /// </returns> |
69 | | - /// <remarks> |
70 | | - /// <para>This method can be used whether the selection consists of a single item or multiple items. <b>IFileOpenDialog::GetResults</b> can be called after the dialog has closed or during the handling of an IFileDialogEvents::OnFileOk event. Calling this method at any other time will fail.</para> |
71 | | - /// <para><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nf-shobjidl_core-imodalwindow-show">Show</a> must return a success code for a result to be available to <b>IFileOpenDialog::GetResults</b>.</para> |
72 | | - /// <para><see href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getresults#">Read more on docs.microsoft.com</see>.</para> |
73 | | - /// </remarks> |
74 | | - HRESULT GetResults(out IShellItemArray ppenum); |
| 66 | + /// <summary>Gets the user's choices in a dialog that allows multiple selection.</summary> |
| 67 | + /// <param name="ppenum"> |
| 68 | + /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a>**</b> The address of a pointer to an <b>IShellItemArray</b> through which the items selected in the dialog can be accessed.</para> |
| 69 | + /// <para><see href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getresults#parameters">Read more on docs.microsoft.com</see>.</para> |
| 70 | + /// </param> |
| 71 | + /// <returns> |
| 72 | + /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> |
| 73 | + /// </returns> |
| 74 | + /// <remarks> |
| 75 | + /// <para>This method can be used whether the selection consists of a single item or multiple items. <b>IFileOpenDialog::GetResults</b> can be called after the dialog has closed or during the handling of an IFileDialogEvents::OnFileOk event. Calling this method at any other time will fail.</para> |
| 76 | + /// <para><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nf-shobjidl_core-imodalwindow-show">Show</a> must return a success code for a result to be available to <b>IFileOpenDialog::GetResults</b>.</para> |
| 77 | + /// <para><see href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getresults#">Read more on docs.microsoft.com</see>.</para> |
| 78 | + /// </remarks> |
| 79 | + HRESULT GetResults(out IShellItemArray ppenum); |
75 | 80 |
|
76 | | - /// <summary>Gets the currently selected items in the dialog. These items may be items selected in the view, or text selected in the file name edit box.</summary> |
77 | | - /// <param name="ppsai"> |
78 | | - /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a>**</b> The address of a pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a> through which the selected items can be accessed.</para> |
79 | | - /// <para><see href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getselecteditems#parameters">Read more on docs.microsoft.com</see>.</para> |
80 | | - /// </param> |
81 | | - /// <returns> |
82 | | - /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> |
83 | | - /// </returns> |
84 | | - /// <remarks>This method can be used for single item or multiple item selections. If the user has entered new text in the file name field, this can be a time-consuming operation. When the application calls this method, the application parses the text in the <c>filename</c> field. For example, if this is a network share, the operation could take some time. However, this operation will not block the UI, since the user should able to stop the operation, which will result in <b>IFileOpenDialog::GetSelectedItems</b> returning a failure code).</remarks> |
85 | | - HRESULT GetSelectedItems(out IShellItemArray ppsai); |
| 81 | + /// <summary>Gets the currently selected items in the dialog. These items may be items selected in the view, or text selected in the file name edit box.</summary> |
| 82 | + /// <param name="ppsai"> |
| 83 | + /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a>**</b> The address of a pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/shobjidl_core/nn-shobjidl_core-ishellitemarray">IShellItemArray</a> through which the selected items can be accessed.</para> |
| 84 | + /// <para><see href="https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getselecteditems#parameters">Read more on docs.microsoft.com</see>.</para> |
| 85 | + /// </param> |
| 86 | + /// <returns> |
| 87 | + /// <para>Type: <b>HRESULT</b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para> |
| 88 | + /// </returns> |
| 89 | + /// <remarks>This method can be used for single item or multiple item selections. If the user has entered new text in the file name field, this can be a time-consuming operation. When the application calls this method, the application parses the text in the <c>filename</c> field. For example, if this is a network share, the operation could take some time. However, this operation will not block the UI, since the user should able to stop the operation, which will result in <b>IFileOpenDialog::GetSelectedItems</b> returning a failure code).</remarks> |
| 90 | + HRESULT GetSelectedItems(out IShellItemArray ppsai); |
| 91 | + } |
86 | 92 | } |
0 commit comments