From c6cab848f92952bd5143d4095e25cac4cc566e69 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 23 Aug 2019 18:16:02 +0100 Subject: [PATCH] Another attempt to sort out the dialog appearing behind other windows. --- Meade.net/SetupDialogForm.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Meade.net/SetupDialogForm.cs b/Meade.net/SetupDialogForm.cs index 2ad1077..2c99826 100644 --- a/Meade.net/SetupDialogForm.cs +++ b/Meade.net/SetupDialogForm.cs @@ -72,9 +72,12 @@ namespace ASCOM.Meade.net return profileProperties; } + [DllImport("user32.dll")] + private static extern bool SetForegroundWindow(IntPtr hWnd); + private void SetupDialogForm_Shown(object sender, EventArgs e) { - BringToFront(); + SetForegroundWindow(Handle); Activate(); }