Пример #1
0
        public Window(IntPtr handle, string className, string text, IEnumerable<Window> childWindows = null, Menu menu = null)
        {
            Handle = handle;
            ClassName = className;
            Text = text;
            ChildWindows = childWindows;
            Menu = menu;
            InputMode = InputMode.Send;

            _commandCreator = new DefaultCommandCreator(handle);
        }
Пример #2
0
        internal Window CreateWindow(IntPtr handle, IEnumerable<Window> childWindows = null)
        {
            var buffer = new StringBuilder(1024);

            GetClassName(handle, buffer, buffer.Capacity);
            var className = buffer.ToString();

            buffer = new StringBuilder(1024);

            GetWindowText(handle, buffer, buffer.Capacity);
            var text = buffer.ToString();

            var menu = new Menu(GetMenu(handle));

            return _windowClassTypes.ContainsKey(className)
                       ? (Window) Activator.CreateInstance(_windowClassTypes[className], handle, className, text, childWindows, menu)
                       : new Window(handle, className, text, childWindows, menu);
        }
Пример #3
0
 public ScrollBar(IntPtr handle, string className, string text, IEnumerable<Window> childWindows, Menu menu)
     : base(handle, className, text, childWindows, menu)
 {
 }