summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samples/OpenIdOfflineProvider/NativeMethods.cs32
1 files changed, 28 insertions, 4 deletions
diff --git a/samples/OpenIdOfflineProvider/NativeMethods.cs b/samples/OpenIdOfflineProvider/NativeMethods.cs
index ec12819..b512d70 100644
--- a/samples/OpenIdOfflineProvider/NativeMethods.cs
+++ b/samples/OpenIdOfflineProvider/NativeMethods.cs
@@ -10,6 +10,9 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
using System.Windows;
using System.Windows.Interop;
+ /// <summary>
+ /// P/Invoke methods and wrappers.
+ /// </summary>
internal static class NativeMethods {
/// <summary>
/// Gets the HWND of the current foreground window on the system.
@@ -17,20 +20,41 @@ namespace DotNetOpenAuth.OpenIdOfflineProvider {
/// <returns>A handle to the foreground window.</returns>
[DllImport("user32.dll")]
internal static extern IntPtr GetForegroundWindow();
-
+
+ /// <summary>
+ /// Sets the foreground window of the system.
+ /// </summary>
+ /// <param name="hWnd">The HWND of the window to set as active.</param>
+ /// <returns>A value indicating whether the foreground window was actually changed.</returns>
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool SetForegroundWindow(IntPtr hWnd);
- [DllImport("user32.dll")]
- private static extern IntPtr SetActiveWindow(IntPtr hWnd);
-
+ /// <summary>
+ /// Sets the foreground window of the system.
+ /// </summary>
+ /// <param name="window">The window to bring to the foreground.</param>
+ /// <returns>
+ /// A value indicating whether the foreground window was actually changed.
+ /// </returns>
internal static bool SetForegroundWindow(Window window) {
return SetForegroundWindow(new WindowInteropHelper(window).Handle);
}
+ /// <summary>
+ /// Sets the active window of the process.
+ /// </summary>
+ /// <param name="window">The window to bring to the foreground.</param>
internal static void SetActiveWindow(Window window) {
SetActiveWindow(new WindowInteropHelper(window).Handle);
}
+
+ /// <summary>
+ /// Sets the active window of the process.
+ /// </summary>
+ /// <param name="hWnd">The HWND of the window to set as active.</param>
+ /// <returns>The window that was previously active?</returns>
+ [DllImport("user32.dll")]
+ private static extern IntPtr SetActiveWindow(IntPtr hWnd);
}
}