Example #1
1
 public static WindowInfo[] GetThreadWindowsInfoList(int threadId)
 {
     EnumWindows enumWindows = new EnumWindows();
     return (from hWnd in enumWindows.GetThreadWindowsList(threadId) select GetWindowInfo(hWnd)).ToArray();
 }
Example #2
0
        public static WindowInfo[] GetProcessWindowsInfoList(Process process, bool mainWindow)
        {
            List <IntPtr> windowsList = new List <IntPtr>();
            EnumWindows   enumWindows = new EnumWindows();

            foreach (ProcessThread thread in process.Threads)
            {
                if (mainWindow)
                {
                    windowsList.AddRange(from hWnd in enumWindows.GetThreadWindowsList(thread.Id) where User.GetParent(hWnd) == IntPtr.Zero select hWnd);
                }
                else
                {
                    windowsList.AddRange(enumWindows.GetThreadWindowsList(thread.Id));
                }
            }
            return((from hWnd in windowsList select GetWindowInfo(hWnd)).ToArray());
        }
Example #3
0
        public static WindowInfo[] GetProcessWindowsInfoListByClassName(Process process, string className)
        {
            List <IntPtr> windowsList = new List <IntPtr>();
            EnumWindows   enumWindows = new EnumWindows();

            foreach (ProcessThread thread in process.Threads)
            {
                windowsList.AddRange(from hWnd in enumWindows.GetThreadWindowsList(thread.Id) where GetWindowClassName(hWnd) == className select hWnd);
            }
            return((from hWnd in windowsList select GetWindowInfo(hWnd)).ToArray());
        }
Example #4
0
 public static IntPtr[] GetThreadWindowsList(int threadId)
 {
     EnumWindows enumWindows = new EnumWindows();
     return enumWindows.GetThreadWindowsList(threadId).ToArray();
 }
Example #5
0
 public static WindowInfo[] GetProcessWindowsInfoListByClassName(Process process, string className)
 {
     List<IntPtr> windowsList = new List<IntPtr>();
     EnumWindows enumWindows = new EnumWindows();
     foreach (ProcessThread thread in process.Threads)
         windowsList.AddRange(from hWnd in enumWindows.GetThreadWindowsList(thread.Id) where GetWindowClassName(hWnd) == className select hWnd);
     return (from hWnd in windowsList select GetWindowInfo(hWnd)).ToArray();
 }
Example #6
0
 public static WindowInfo[] GetProcessWindowsInfoList(Process process, bool mainWindow)
 {
     List<IntPtr> windowsList = new List<IntPtr>();
     EnumWindows enumWindows = new EnumWindows();
     foreach (ProcessThread thread in process.Threads)
     {
         if (mainWindow)
             windowsList.AddRange(from hWnd in enumWindows.GetThreadWindowsList(thread.Id) where User.GetParent(hWnd) == IntPtr.Zero select hWnd);
         else
             windowsList.AddRange(enumWindows.GetThreadWindowsList(thread.Id));
     }
     return (from hWnd in windowsList select GetWindowInfo(hWnd)).ToArray();
 }
Example #7
0
        public static WindowInfo[] GetThreadWindowsInfoList(int threadId)
        {
            EnumWindows enumWindows = new EnumWindows();

            return((from hWnd in enumWindows.GetThreadWindowsList(threadId) select GetWindowInfo(hWnd)).ToArray());
        }
Example #8
0
        public static IntPtr[] GetThreadWindowsList(int threadId)
        {
            EnumWindows enumWindows = new EnumWindows();

            return(enumWindows.GetThreadWindowsList(threadId).ToArray());
        }