示例#1
0
            public static void OpenDefaultApplication(JavaOMI omi, DefaultWindowApp app)
            {
                bool   foundCmd = true;
                string cmd      = "";

                switch (app)
                {
                case DefaultWindowApp.Notepad:
                    cmd = START + "notpad.exe"; break;

                case DefaultWindowApp.Calculatrice:
                    cmd = START + "calc.exe"; break;

                case DefaultWindowApp.CMD:
                    cmd = START + "cmd.exe"; break;

                case DefaultWindowApp.VirtualKeyboard:
                    cmd = START + "osk.exe"; break;

                default:
                    foundCmd = false;
                    break;
                }
                if (foundCmd)
                {
                    omi.WindowCommand(cmd);
                }
            }
示例#2
0
        public static JavaOpenMacroCommunicationProcess CreateDefaultOne(out JavaOMI shortcut, int port = 2501, string ip = "127.0.0.1", System.Threading.ThreadPriority priority = System.Threading.ThreadPriority.Normal)
        {
            JavaOpenMacroCommunicationProcess p = new JavaOpenMacroCommunicationProcess(ip, port, priority);

            shortcut = new JavaOMI(p);
            return(p);
        }
示例#3
0
            public static IEnumerator WindowSearchAndValidate(JavaOMI item, string toSearch)
            {
                item.Keyboard(JavaKeyEvent.VK_WINDOWS);
                yield return(new WaitForSeconds(0.5f));

                item.PastText(toSearch);
                yield return(new WaitForSeconds(0.5f));

                item.Keyboard(JavaKeyEvent.VK_ENTER);
            }
示例#4
0
 public static void OpenLnkFromStartup(JavaOMI omi, string relativePath, bool userOne = false)
 {
     if (userOne)
     {
         omi.WindowCommand(string.Format(startupPath, relativePath));
     }
     else
     {
         omi.WindowCommand(string.Format(startupWinPath, relativePath));
     }
 }
示例#5
0
 public static void GoToStartup(JavaOMI omi, bool userOne = false)
 {
     if (userOne)
     {
         omi.WindowCommand(START + "\"%USERPROFILE%\\Start Menu\\Programs\\\"");
     }
     else
     {
         omi.WindowCommand(START + "\"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\"");
     }
 }
示例#6
0
            public static void OpenConfigPanel(JavaOMI omi, string panelEnumTypeName)
            {
                ControlPanelEnum e = ControlPanelEnum.AdminTools;

                try
                {
                    e = (ControlPanelEnum)Enum.Parse(typeof(ControlPanelEnum), panelEnumTypeName);
                }
                catch (Exception) { return; }
                OpenConfigPanel(omi, e);
            }
示例#7
0
        //public static void RenameRegistered(string oldName, string newName, out bool findAndRenamed)
        //{

        //    findAndRenamed = false;
        //    JavaOMI server = GetRegistered(oldName);
        //    if (server != null) {
        //        m_readyToUseRegister.Add(newName, server);
        //        m_readyToUseRegister.Remove(oldName);
        //        findAndRenamed = true;
        //        NotifyThreadChange(newName);
        //    }

        //}

        public static void RegisterShortcut(string name, JavaOMI running, bool overrideExistingOne = true)
        {
            if (!IsServerRegistered(name))
            {
                m_readyToUseRegister.Add(name, running);
            }
            else if (overrideExistingOne)
            {
                m_readyToUseRegister[name] = running;
            }

            NotifyThreadChange(name);
        }
示例#8
0
            public static IEnumerator GoToParametersWithSearch(JavaOMI item, string keywordToSearch, float timeToWaitWinToOne = 2.5f, float enterDelayTime = 1f)
            {
                item.WindowCommand("control /name Microsoft.WindowsUpdate");
                yield return(new WaitForSeconds(timeToWaitWinToOne));

                item.PastText(keywordToSearch);
                yield return(new WaitForSeconds(1f));

                item.Keyboard(JavaKeyEvent.VK_ENTER);
                yield return(new WaitForSeconds(1f));

                item.Keyboard(JavaKeyEvent.VK_ENTER);
                yield break;
            }
示例#9
0
            public static IEnumerator GoToHotspotConfig(JavaOMI item, float timeToWaitWinToOpne = 2.5f)
            {
                item.WindowCommand("control /name Microsoft.WindowsUpdate");
                yield return(new WaitForSeconds(timeToWaitWinToOpne));

                item.Keyboard(JavaKeyEvent.VK_M);
                item.Keyboard(JavaKeyEvent.VK_O);
                item.Keyboard(JavaKeyEvent.VK_B);
                item.Keyboard(JavaKeyEvent.VK_I);
                item.Keyboard(JavaKeyEvent.VK_L);
                item.Keyboard(JavaKeyEvent.VK_E);
                yield return(new WaitForSeconds(1f));

                item.Keyboard(JavaKeyEvent.VK_ENTER);
                yield return(new WaitForSeconds(1f));

                item.Keyboard(JavaKeyEvent.VK_ENTER);
                yield break;
            }
示例#10
0
 public static IEnumerator GoToHotspotConfig(JavaOMI item, float timeToWaitWinToOne = 2.5f, float enterDelayTime = 1f)
 {
     return(GoToParametersWithSearch(item, "mobile", timeToWaitWinToOne, enterDelayTime));
 }
示例#11
0
 public static IEnumerator GoToDeveloperConfig(JavaOMI item, float timeToWaitWinToOne = 2.5f, float enterDelayTime = 1f)
 {
     return(GoToParametersWithSearch(item, "developer", timeToWaitWinToOne, enterDelayTime));
 }
示例#12
0
 public static void CallShutdown(JavaOMI omi)
 {
     omi.WindowCommand("shutdown /s /t 0");
 }
示例#13
0
 internal static void GoToUserDirectory(JavaOMI item, string relativePathInUserDir)
 {
     //Debug.Log ("cd %userprofile%/ " + relativePathInUserDir);
     item.WindowCommand("start %userprofile%/" + relativePathInUserDir);
 }
示例#14
0
 internal static void TaskManager(JavaOMI item)
 {
     item.SendShortcutCommands("ctrl↓ alt↓ escape↕ alt↑ ctlr↑");
 }
示例#15
0
 internal static void GoToUserDownload(JavaOMI item)
 {
     GoToUserDirectory(item, "downloads");
 }
示例#16
0
 internal static void GoToUserDesktop(JavaOMI item)
 {
     GoToUserDirectory(item, "desktop");
 }
示例#17
0
 internal static void GoToUserMusic(JavaOMI item)
 {
     GoToUserDirectory(item, "music");
 }
示例#18
0
 internal static void GoToUserScreenshots(JavaOMI item)
 {
     GoToUserDirectory(item, "pictures/screenshots");
 }
示例#19
0
 internal static void GoToUserImage(JavaOMI item)
 {
     GoToUserDirectory(item, "pictures");
 }
示例#20
0
 internal static void GoToUserVideo(JavaOMI item)
 {
     GoToUserDirectory(item, "videos");
 }
示例#21
0
 internal static void GoToUserDocument(JavaOMI item)
 {
     GoToUserDirectory(item, "documents");
 }
示例#22
0
 internal static void CtrlAltDelete(JavaOMI item)
 {
     item.SendShortcutCommands("ctrl↓ alt↓ delete↕ alt↑ ctrl↑");
 }
示例#23
0
 internal static void ForceQuitCurrentApp(JavaOMI item)
 {
     item.SendShortcutCommands("ctrl↓ alt↓ f4↕ alt↑ ctrl↑");
 }
示例#24
0
 internal static void GoToFullWindowInformation(JavaOMI item)
 {
     item.WindowCommand("msinfo32");
 }
示例#25
0
 internal static void GoToPaint(JavaOMI item)
 {
     item.WindowCommand("mspaint");
 }
示例#26
0
 internal static void TakeScreenshot(JavaOMI item)
 {
     item.SendShortcutCommands("Window↓ VK_PRINTSCREEN↕  Window↑");
 }
示例#27
0
 internal static void SwitchKeyboardLayout(JavaOMI item)
 {
     item.SendShortcutCommands("window↓ space↕ window↑");
 }
示例#28
0
 internal static void GoToControlPanel(JavaOMI item)
 {
     item.WindowCommand("control panel");
     item.Keyboard(JavaKeyEvent.VK_ENTER);
 }
示例#29
0
 public static void OpenExePath(JavaOMI omi, string pathWithExe)
 {
     omi.WindowCommand(START + string.Format(" \"{0}\"", pathWithExe));
 }
示例#30
0
 public static void CallCaptureScreen(JavaOMI omi)
 {
     omi.SendShortcutCommands("Shift↓ Window↓ S↕  Window↑ Shift↑");
 }