Пример #1
0
        internal static IEnumerable <IntPtr> GetDesktopWindows()
        {
            IList <IntPtr> result   = new List <IntPtr>();
            WindowEnumProc callback = new WindowEnumProc((hwnd, lparam) => { result.Add(hwnd); return(true); });

            EnumWindows(callback, IntPtr.Zero);
            return(result);
        }
Пример #2
0
        private static IntPtr[] FindWindows(IntPtr parentWnd, string title, string className)
        {
            var data = new SearchData()
            {
                ClassName = className,
                Title     = title
            };

            var callbackProc = new WindowEnumProc(EnumChildWindowsCallback);

            EnumChildWindows(parentWnd, callbackProc, ref data);

            return(data.Results.ToArray());
        }
Пример #3
0
        public static List <IntPtr> GetAllChildHandles(IntPtr mainHandle)
        {
            List <IntPtr> childHandles = new List <IntPtr>();

            GCHandle gcChildhandlesList      = GCHandle.Alloc(childHandles);
            IntPtr   pointerChildHandlesList = GCHandle.ToIntPtr(gcChildhandlesList);

            try
            {
                WindowEnumProc childProc = new WindowEnumProc(EnumWindow);
                EnumChildWindows(mainHandle, childProc, pointerChildHandlesList);
            }
            finally
            {
                gcChildhandlesList.Free();
            }

            return(childHandles);
        }
Пример #4
0
 private static extern bool EnumChildWindows(IntPtr hWnd, WindowEnumProc func, IntPtr lParam);
Пример #5
0
 static extern bool EnumWindows(WindowEnumProc lpEnumFunc, IntPtr lParam);
Пример #6
0
 internal static extern bool EnumChildWindows(IntPtr hwnd, WindowEnumProc func, IntPtr lParam);
Пример #7
0
		[DllImport("user32.dll")]		public static extern bool 		EnumThreadWindows			(int threadId, WindowEnumProc func, IntPtr lParam);
 public static extern bool EnumChildWindows(IntPtr hwnd, WindowEnumProc callback, IntPtr lParam);
Пример #9
0
 internal static extern bool EnumWindows(WindowEnumProc callPtr, IntPtr lParam);
Пример #10
0
 public static extern bool EnumWindows(WindowEnumProc func, IntPtr lParam);
Пример #11
0
 public static extern bool EnumChildWindows(IntPtr hWnd, WindowEnumProc func, ref SearchData lParam);
Пример #12
0
 static extern bool EnumWindows(WindowEnumProc enumProc, int lparam);
Пример #13
0
 public static extern bool EnumWindows(WindowEnumProc enumFunc, int lParam);
Пример #14
0
 internal static extern bool EnumWindows(WindowEnumProc callPtr, IntPtr lParam);
Пример #15
0
 public static extern bool EnumChildWindows(IntPtr hwnd, WindowEnumProc lpEnumCallbackFunction, IntPtr lParam);
 private static extern bool EnumWindows(WindowEnumProc enumFunc, uint lParam);
Пример #17
0
 public static extern bool EnumDesktopWindows(IntPtr hDesktop, WindowEnumProc lpEnumCallbackFunction, IntPtr lParam);
Пример #18
0
 [DllImport("user32.dll")]               public static extern bool               EnumChildWindows(IntPtr hwnd, WindowEnumProc func, IntPtr lParam);
Пример #19
0
		[DllImport("user32.dll")]		public static extern bool 		EnumChildWindows			(IntPtr hwnd, WindowEnumProc func, IntPtr lParam);
Пример #20
0
 [DllImport("user32.dll")]               public static extern bool               EnumThreadWindows(int threadId, WindowEnumProc func, IntPtr lParam);
Пример #21
0
 public static extern bool EnumThreadWindows(int threadId, WindowEnumProc func, IntPtr lParam);
Пример #22
0
 public static extern bool EnumThreadWindows(int threadId, WindowEnumProc func, IntPtr lParam);
Пример #23
0
		internal static extern bool EnumChildWindows(IntPtr hwnd, WindowEnumProc func, IntPtr lParam);
Пример #24
0
 private static extern bool EnumChildWindows(IntPtr window, WindowEnumProc callback, IntPtr lParam);