[Settings]Fix ZoomIt page changing current directory (#37052)

This commit is contained in:
Jaime Bernardo
2025-01-24 14:34:49 +00:00
committed by GitHub
parent eeeabc82c9
commit fb35c93877
3 changed files with 8 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
openFileName.Title = title;
openFileName.FilterIndex = initialFilter;
openFileName.DefExt = null;
openFileName.Flags = (int)OpenFileNameFlags.OFN_NOCHANGEDIR; // OFN_NOCHANGEDIR flag is needed, because otherwise GetOpenFileName overwrites the process working directory.
IntPtr windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(App.GetSettingsWindow());
openFileName.Hwnd = windowHandle;