Ejemplo n.º 1
0
        public static List <IntPtr> GetChildWindows(IntPtr parent)
        {
            List <IntPtr> numList  = new List <IntPtr>();
            GCHandle      gcHandle = GCHandle.Alloc((object)numList);

            try
            {
                WindowsAPI.EnumWindowsProc lpEnumFunc = new WindowsAPI.EnumWindowsProc(WindowsAPI.EnumWindow);
                WindowsAPI.EnumChildWindows(parent, lpEnumFunc, GCHandle.ToIntPtr(gcHandle));
            }
            finally
            {
                if (gcHandle.IsAllocated)
                {
                    gcHandle.Free();
                }
            }
            return(numList);
        }
Ejemplo n.º 2
0
 private static extern bool EnumChildWindows(
     IntPtr hwndParent,
     WindowsAPI.EnumWindowsProc lpEnumFunc,
     IntPtr lParam);
Ejemplo n.º 3
0
 public static extern int EnumWindows(WindowsAPI.EnumWindowsProc ewp, int lParam);