要用到WIN32API   EnumWindows,但是我不会用
会用的帮忙写个例子,谢谢

解决方案 »

  1.   

    using System.Runtime.InteropServices;public delegate bool WNDENUMPROC(IntPtr hwnd, int lParam);[DllImport("user32.dll")]
    public static extern int EnumWindows(WNDENUMPROC lpEnumFunc, int lParam);public static bool EnumFunc(IntPtr hwnd, int lParam)
    {
        Console.WriteLine("Window handle is " + hwnd);
        return true;
    }private void button1_Click(object sender, EventArgs e)
    {
        EnumWindows(EnumFunc, 0);
    }