public ApiWindow[] GetChildWindows(IntPtr hwnd)
            {
                _listChildren.Clear();

                EnumCallBackDelegate enumChildWindowProc = delegate(IntPtr inthwnd, int lParam) {
                    var window = GetWindowIdentification(inthwnd);
                    if (_childClass.Length == 0 || _childClass.ToLower().Equals(window.ClassName.ToLower()))
                    {
                        _listChildren.Add(window);
                    }
                    return(1);
                };

                EnumChildWindows(hwnd, enumChildWindowProc, 0);
                return(_listChildren.ToArray());
            }
            public ApiWindow[] GetTopLevelWindows()
            {
                EnumCallBackDelegate enumWindowProc = delegate(IntPtr inthwnd, int lParam) {
                    if (GetParent(inthwnd) != 0 || IsWindowVisible(inthwnd) != 0)
                    {
                        return(1);
                    }
                    var window = GetWindowIdentification(inthwnd);
                    if (_topLevelClass.Length == 0 || _topLevelClass.ToLower().Equals(window.ClassName.ToLower()))
                    {
                        _listTopLevel.Add(window);
                    }
                    return(1);
                };

                EnumWindows(enumWindowProc, 0);
                return(_listTopLevel.ToArray());
            }
Exemplo n.º 3
0
 private static extern int EnumChildWindows(int hWndParent, EnumCallBackDelegate lpEnumFunc, int lParam);
Exemplo n.º 4
0
 private static extern int EnumWindows(EnumCallBackDelegate lpEnumFunc, int lParam);
Exemplo n.º 5
0
Arquivo: Win32.cs Projeto: minskowl/MY
 public static extern bool EnumWindows(EnumCallBackDelegate lpEnumFunc, IntPtr lParam);
 private static extern int EnumChildWindows(int hWndParent, EnumCallBackDelegate lpEnumFunc, int lParam);
 private static extern int EnumWindows(EnumCallBackDelegate lpEnumFunc, int lParam);