mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[Registry Preview] Moving to a different API to call the File Picker (#25260)
* Moving from FileOpenPicker Moving from FileOpenPicker to a Win32/PInvoke version, so it can be opened while running as Admin. * Update Resources.resw Replacing a lost string. * Save file picker also crashed Switched to Win32-based SafeFilePicker Cleaned up some of the code which should now pass spell checking and removed pragmas
This commit is contained in:
39
src/modules/registrypreview/RegistryPreviewUI/FileName.cs
Normal file
39
src/modules/registrypreview/RegistryPreviewUI/FileName.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// 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
|
||||
{
|
||||
// Workaround for File Pickers that don't work while running as admin, per:
|
||||
// https://github.com/microsoft/WindowsAppSDK/issues/2504
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
||||
public struct FileName
|
||||
{
|
||||
public int StructSize;
|
||||
public IntPtr HwndOwner;
|
||||
public IntPtr Instance;
|
||||
public string Filter;
|
||||
public string CustomFilter;
|
||||
public int MaxCustFilter;
|
||||
public int FilterIndex;
|
||||
public string File;
|
||||
public int MaxFile;
|
||||
public string FileTitle;
|
||||
public int MaxFileTitle;
|
||||
public string InitialDir;
|
||||
public string Title;
|
||||
public int Flags;
|
||||
public short FileOffset;
|
||||
public short FileExtension;
|
||||
public string DefExt;
|
||||
public IntPtr CustData;
|
||||
public IntPtr Hook;
|
||||
public string TemplateName;
|
||||
public IntPtr PtrReserved;
|
||||
public int Reserved;
|
||||
public int FlagsEx;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user