Пример #1
0
        public static IntPtr GetControlHandle(string title, string control)
        {
            IntPtr handle = AutoSpy.GetHandle(title, null);
            IntPtr result = AutoItX.ControlGetHandle(handle, control);

            if (result.ToInt32() == 0)
            {
                throw new Exception("ControlHandle not found");
            }
            return(result);
        }
Пример #2
0
 public bool RestartAndroid()
 {
     try
     {
         AutoSpy autoSpy = new AutoSpy(AutoSpy.GetHandle(BlueStacks.HANDLE_TITLE, null), AutoSpy.GetControlHandle(BlueStacks.HANDLE_TITLE, BlueStacks.SETTINGS_HANDLE_TITLE));
         autoSpy.FocusWindow();
         autoSpy.Click(16, 9, 1, 0, "left");
         autoSpy.PressKey(40u, 2, 100);
         autoSpy.PressKey(13u, 1, 100);
     }
     catch (Exception)
     {
         return(false);
     }
     return(this.Hook());
 }
Пример #3
0
        public bool Hook()
        {
            bool result;

            try
            {
                MainWindowAS = new AutoSpy(AutoSpy.GetHandle(HANDLE_TITLE, null), AutoSpy.GetControlHandle(HANDLE_TITLE, BlueStacks.CONTROL_HANDLE_TITLE));
                Show(true);
                result = true;
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }
Пример #4
0
        public bool Hook()
        {
            bool result;

            try
            {
                this.MainWindowAS = new AutoSpy(AutoSpy.GetHandle(BlueStacks.HANDLE_TITLE, null), AutoSpy.GetControlHandle(BlueStacks.HANDLE_TITLE, BlueStacks.CONTROL_HANDLE_TITLE));
                this.SideMenuAS   = new AutoSpy(AutoSpy.GetHandle("", BlueStacks.SIDE_MENU_HANDLE_TITLE));
                this.Show(true);
                result = true;
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }