mirror of
https://github.com/AssetRipper/AssetRipper.NativeDialogs.git
synced 2026-11-13 18:06:41 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
96c537b7e8 | ||
|
|
505d4dc16d | ||
|
|
49e71fc0a5 | ||
|
|
0ca1fdb1dc | ||
|
|
63278e1a51 |
No files matched your search
@@ -40,7 +40,7 @@ public static class OpenFileDialog
|
||||
{
|
||||
OPENFILENAMEW ofn = default;
|
||||
ofn.lStructSize = (uint)Unsafe.SizeOf<OPENFILENAMEW>();
|
||||
ofn.hwndOwner = default; // No owner window.
|
||||
ofn.hwndOwner = Windows.GetConsoleWindow(); // Use console window as owner to ensure dialog comes to foreground
|
||||
ofn.lpstrFile = bufferPtr;
|
||||
ofn.nMaxFile = (uint)buffer.Length;
|
||||
ofn.lpstrFilter = filterPtr;
|
||||
@@ -119,7 +119,7 @@ public static class OpenFileDialog
|
||||
{
|
||||
OPENFILENAMEW ofn = default;
|
||||
ofn.lStructSize = (uint)Unsafe.SizeOf<OPENFILENAMEW>();
|
||||
ofn.hwndOwner = default; // No owner window.
|
||||
ofn.hwndOwner = Windows.GetConsoleWindow(); // Use console window as owner to ensure dialog comes to foreground
|
||||
ofn.lpstrFile = bufferPtr;
|
||||
ofn.nMaxFile = (uint)buffer.Length;
|
||||
ofn.lpstrFilter = filterPtr;
|
||||
|
||||
@@ -90,8 +90,9 @@ public static class OpenFolderDialog
|
||||
pFileDialog->GetOptions(&dwOptions);
|
||||
pFileDialog->SetOptions(dwOptions | (uint)FILEOPENDIALOGOPTIONS.FOS_PICKFOLDERS | (uint)FILEOPENDIALOGOPTIONS.FOS_FORCEFILESYSTEM);
|
||||
|
||||
// Show the dialog
|
||||
hr = pFileDialog->Show(default);
|
||||
// Show the dialog with console window as owner to ensure it comes to foreground
|
||||
HWND hwndOwner = Windows.GetConsoleWindow();
|
||||
hr = pFileDialog->Show(hwndOwner);
|
||||
if (Windows.SUCCEEDED(hr))
|
||||
{
|
||||
IShellItem* pItem;
|
||||
@@ -221,8 +222,9 @@ public static class OpenFolderDialog
|
||||
|
||||
string[]? result = null;
|
||||
|
||||
// Show the dialog
|
||||
hr = pFileDialog->Show(default);
|
||||
// Show the dialog with console window as owner to ensure it comes to foreground
|
||||
HWND hwndOwner = Windows.GetConsoleWindow();
|
||||
hr = pFileDialog->Show(hwndOwner);
|
||||
if (Windows.SUCCEEDED(hr))
|
||||
{
|
||||
IShellItemArray* pItemArray;
|
||||
|
||||
@@ -61,6 +61,11 @@ internal static class ProcessExecutor
|
||||
[SupportedOSPlatform("linux")]
|
||||
public static async Task<bool> HasCommand(string command)
|
||||
{
|
||||
ArgumentException.ThrowIfNullOrEmpty(command);
|
||||
if (!File.Exists("/bin/bash"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
string? result = await TryRun("/bin/bash", "-c", $"command -v {EscapeString(command)}");
|
||||
return !string.IsNullOrEmpty(result);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public static class SaveFileDialog
|
||||
{
|
||||
OPENFILENAMEW ofn = default;
|
||||
ofn.lStructSize = (uint)Unsafe.SizeOf<OPENFILENAMEW>();
|
||||
ofn.hwndOwner = default; // No owner window.
|
||||
ofn.hwndOwner = Windows.GetConsoleWindow(); // Use console window as owner to ensure dialog comes to foreground
|
||||
ofn.lpstrFile = bufferPtr;
|
||||
ofn.nMaxFile = (uint)buffer.Length;
|
||||
ofn.lpstrFilter = filterPtr;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||
|
||||
<VersionPrefix>1.1.0</VersionPrefix>
|
||||
<VersionPrefix>1.1.2</VersionPrefix>
|
||||
<Copyright>Copyright (c) 2026 ds5678</Copyright>
|
||||
<Authors>ds5678</Authors>
|
||||
<Company>AssetRipper</Company>
|
||||
|
||||
@@ -6,7 +6,7 @@ A cross-platform library for picking files and folders in .NET applications.
|
||||
|
||||
On Windows, downstream projects must disable `CETCompat`. Leaving it enabled may cause crashes when opening native file dialogs.
|
||||
|
||||
Add the following to the consuming project’s `.csproj`:
|
||||
Add the following to the consuming project `.csproj` file:
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
|
||||
Reference in new issue
Block a user