public static void SetWindowText(IntPtr windowHandle, string title)
{
// Check if the handle is valid
HandleManipulator.ValidateAsArgument(windowHandle, "windowHandle");
// Set the text of the window's title bar
if (!NativeMethods.SetWindowText(windowHandle, title))
throw new Win32Exception("Couldn't set the text of the window's title bar.");
}