示例#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);
        }
示例#2
0
 private static extern bool EnumChildWindows(
     IntPtr hwndParent,
     WindowsAPI.EnumWindowsProc lpEnumFunc,
     IntPtr lParam);
示例#3
0
 public static extern int EnumWindows(WindowsAPI.EnumWindowsProc ewp, int lParam);