mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
[RegistryPreview]Fix duplicate file pickers, open modal (#32025)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace RegistryPreview
|
||||
@@ -13,11 +14,12 @@ namespace RegistryPreview
|
||||
[DllImport("comdlg32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
private static extern bool GetOpenFileName(ref FileName openFileName);
|
||||
|
||||
public static string ShowDialog(string filter, string dialogTitle)
|
||||
public static string ShowDialog(IntPtr windowHandle, string filter, string dialogTitle)
|
||||
{
|
||||
FileName openFileName = default(FileName);
|
||||
openFileName.StructSize = Marshal.SizeOf(openFileName);
|
||||
|
||||
openFileName.HwndOwner = windowHandle;
|
||||
openFileName.Filter = filter;
|
||||
openFileName.File = new string(new char[256]);
|
||||
openFileName.MaxFile = openFileName.File.Length;
|
||||
|
||||
Reference in New Issue
Block a user