Ejemplo n.º 1
0
        public static void SpeakWindowRect()
        {
            int[]  Rect = MagicKeys.GetWinRect(MagicKeys.GetForegroundWindow());
            string R    = T._("Width") + " " + (Rect[2] - P[1]).ToString() + ", " + T._("Height") + " " + (Rect[3] - P[2]).ToString();

            MagicKeys.Speak(R);
        }
Ejemplo n.º 2
0
        public static int[] GetPluginCoord()
        {
            int[]  ControlCoord;
            IntPtr Handle = MagicKeys.GetForegroundWindow();

            int[] RC = MagicKeys.GetWinRect(Handle);
            for (int X = RC[0]; X < RC[2]; X += 100)
            {
                for (int Y = RC[1]; Y < RC[3]; Y += 150)
                {
                    IntPtr HModule    = MagicKeys.GetWinPointHandle(X, Y);
                    string ModuleName = MagicKeys.GetDllName(HModule);
                    if (ModuleName.Contains(Module, StringComparison.OrdinalIgnoreCase) == true)
                    {
                        Module = ModuleName;
                        int[] RectCTRL = MagicKeys.GetWinRect(MagicKeys.GetWinPointHandle(X, Y));
                        ControlCoord = new int[5] {
                            1, RectCTRL[0], RectCTRL[1], RectCTRL[2] - 1, RectCTRL[3] - 1
                        };
                        return(ControlCoord);
                    }
                }
            }
            ControlCoord = new int[5] {
                0, 0, 0, 0, 0
            };
            return(ControlCoord);
        }
Ejemplo n.º 3
0
        public static void ControlSearch()
        {
            KeyUnReg();
            OptionKeyUnReg();
            string ModuleName = MagicKeys.InputTextBox("Enter sub string for calling module", "ControlSearch");

            if (ModuleName == "0")
            {
                OptionKeyReg();
                return;
            }
            Module = ModuleName;
            MagicKeys.SetWindowPos(MagicKeys.GetForegroundWindow(), 0, 10, 10, 0, 0, MKC.SWP_NOSIZE | MKC.SWP_NOACTIVATE | MKC.SWP_NOZORDER);
            P = GetPluginCoord();
            if (P[0] == 1)
            {
                MagicKeys.Speak("Module found");
                MagicKeys.MouseMove(P[1], P[2], 0);
                KeyReg();
                OptionKeyReg();
                MagicKeys.SoundPlay("WindowOpened", 0);
                Directory.CreateDirectory(@".\DevSave\" + Module);
                ModuleFound();
                KeyUnReg();
                MagicKeys.SoundPlay("WindowClosed", 0);
            }
            else
            {
                MagicKeys.Speak("Not found");
                OptionKeyReg();
            }
        }