[DllImport("User32.Dll")]
public static extern int GetWindowText(int h, StringBuilder s, int nMaxCount);
//// under the forms designer area.
////
private void button5_Click(object sender, System.EventArgs e)
{
StringBuilder strString = new StringBuilder(256);
//buffer for the text we want to receive.
int i;
i = GetWindowText(this.button1.Handle.ToInt32(),strString,256);
MessageBox.Show (strString.ToString());
}