dont bind to window if there is no active
This commit is contained in:
@@ -53,7 +53,10 @@ public static class LoaderTools
|
||||
throw new ArgumentOutOfRangeException(nameof(buttons), buttons, null);
|
||||
}
|
||||
|
||||
WinRT.Interop.InitializeWithWindow.Initialize(dialog, Process.GetCurrentProcess().MainWindowHandle);
|
||||
var hwnd = Process.GetCurrentProcess().MainWindowHandle;
|
||||
|
||||
if (hwnd != IntPtr.Zero)
|
||||
WinRT.Interop.InitializeWithWindow.Initialize(dialog, hwnd);
|
||||
|
||||
var result = dialog.ShowAsync().AsTask().Result;
|
||||
|
||||
|
Reference in New Issue
Block a user