分类：电脑/网络-互联网
问题：请能给我一个GetWindowText的实例？C#的！ 
回答：using ;using System.Text;using System.Runtime.InteropServices;class Program{    [DllImport("user32.dll")]    public extern static int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);    [DllImport("user32.dll")]    public extern static IntPtr GetForegroundWindow();    static void Main(string[] args)    {        StringBuilder str = new StringBuilder(512);        GetWindowText(GetForegroundWindow(), str, str.Capacity);        Console.WriteLine(str.ToString());        Console.ReadKey();    }}