2 Commits
Author SHA1 Message Date
ds5678 96c537b7e8 Bump version to 1.1.2
Updated VersionPrefix in Directory.Build.props from 1.1.1 to 1.1.2 to prepare for a new release. No other changes were made.
2026-02-17 14:55:49 -08:00
MrBub 505d4dc16d Fix: Make file/folder dialogs automatically come to foreground on Windows (#16) 2026-02-06 17:50:40 -08:00
4 changed files with 10 additions and 8 deletions

No files matched your search

+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<VersionPrefix>1.1.1</VersionPrefix>
<VersionPrefix>1.1.2</VersionPrefix>
<Copyright>Copyright (c) 2026 ds5678</Copyright>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>