念获得任务栏中所有打开窗口的窗口标题和托盘运行程序的程序标题或进程句柄

想获得任务栏中所有打开窗口的窗口标题和托盘运行程序的程序标题或进程句柄
念获得任务栏中所有打开窗口的窗口标题和托盘运行程序的程序标题或进程句柄
最近研究了一下windowAPI,发现不是很懂,特地过来请教一下
[DllImport("User32.dll")]
        public static extern int EnumWindows(CallBack x, int y);//所有进程窗口

        [DllImport("User32.dll")]
        public extern static int GetWindowText(int hWnd, StringBuilder lpString, int nMaxCount);
        public static bool Report(int hwnd, int lParam)
        {
            string name = "";
            StringBuilder windowname = new StringBuilder(50000);
            if (GetWindowText(hwnd, windowname, 50000) > 0)
            {
                name = windowname.ToString();
            }
            if (name.Length > 0)
            {
                MessageBox.Show("Window handle is :" + hwnd + "名字为" + name + "\n");
            }
            return true;
        }

        public delegate bool CallBack(int hwnd, int lParam);
        private void Form1_Load(object sender, EventArgs e)
        {
            CallBack myCallBack = new CallBack(Report);
            EnumWindows(myCallBack, 0);
}

我现在这样是可以获取到所有窗口名,但是有很多信息是没用的,我要过滤掉请问有没有什么好方法
------解决方案--------------------
有一些系统的隐藏窗口,比如自动完成提示、输入法、电源等等,你可以建立一个列表,然后比对后过滤。

当然,如果你不要任何隐藏窗口,直接调用IsWindowVisible函数