diff options
Diffstat (limited to 'samples/OpenIdOfflineProvider/MainWindow.xaml.cs')
-rw-r--r-- | samples/OpenIdOfflineProvider/MainWindow.xaml.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/samples/OpenIdOfflineProvider/MainWindow.xaml.cs b/samples/OpenIdOfflineProvider/MainWindow.xaml.cs index 56ce7b6..a0ee56e 100644 --- a/samples/OpenIdOfflineProvider/MainWindow.xaml.cs +++ b/samples/OpenIdOfflineProvider/MainWindow.xaml.cs @@ -124,7 +124,12 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider { authRequest.IsAuthenticated = false; break; case 2: + IntPtr oldForegroundWindow = NativeMethods.GetForegroundWindow(); + bool stoleFocus = NativeMethods.SetForegroundWindow(this); CheckIdWindow.ProcessAuthentication(this.hostedProvider, authRequest); + if (stoleFocus) { + NativeMethods.SetForegroundWindow(oldForegroundWindow); + } break; } } |