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); } }
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); }
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); }
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)); } }
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\""); } }
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); }
//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); }
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; }
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; }
public static IEnumerator GoToHotspotConfig(JavaOMI item, float timeToWaitWinToOne = 2.5f, float enterDelayTime = 1f) { return(GoToParametersWithSearch(item, "mobile", timeToWaitWinToOne, enterDelayTime)); }
public static IEnumerator GoToDeveloperConfig(JavaOMI item, float timeToWaitWinToOne = 2.5f, float enterDelayTime = 1f) { return(GoToParametersWithSearch(item, "developer", timeToWaitWinToOne, enterDelayTime)); }
public static void CallShutdown(JavaOMI omi) { omi.WindowCommand("shutdown /s /t 0"); }
internal static void GoToUserDirectory(JavaOMI item, string relativePathInUserDir) { //Debug.Log ("cd %userprofile%/ " + relativePathInUserDir); item.WindowCommand("start %userprofile%/" + relativePathInUserDir); }
internal static void TaskManager(JavaOMI item) { item.SendShortcutCommands("ctrl↓ alt↓ escape↕ alt↑ ctlr↑"); }
internal static void GoToUserDownload(JavaOMI item) { GoToUserDirectory(item, "downloads"); }
internal static void GoToUserDesktop(JavaOMI item) { GoToUserDirectory(item, "desktop"); }
internal static void GoToUserMusic(JavaOMI item) { GoToUserDirectory(item, "music"); }
internal static void GoToUserScreenshots(JavaOMI item) { GoToUserDirectory(item, "pictures/screenshots"); }
internal static void GoToUserImage(JavaOMI item) { GoToUserDirectory(item, "pictures"); }
internal static void GoToUserVideo(JavaOMI item) { GoToUserDirectory(item, "videos"); }
internal static void GoToUserDocument(JavaOMI item) { GoToUserDirectory(item, "documents"); }
internal static void CtrlAltDelete(JavaOMI item) { item.SendShortcutCommands("ctrl↓ alt↓ delete↕ alt↑ ctrl↑"); }
internal static void ForceQuitCurrentApp(JavaOMI item) { item.SendShortcutCommands("ctrl↓ alt↓ f4↕ alt↑ ctrl↑"); }
internal static void GoToFullWindowInformation(JavaOMI item) { item.WindowCommand("msinfo32"); }
internal static void GoToPaint(JavaOMI item) { item.WindowCommand("mspaint"); }
internal static void TakeScreenshot(JavaOMI item) { item.SendShortcutCommands("Window↓ VK_PRINTSCREEN↕ Window↑"); }
internal static void SwitchKeyboardLayout(JavaOMI item) { item.SendShortcutCommands("window↓ space↕ window↑"); }
internal static void GoToControlPanel(JavaOMI item) { item.WindowCommand("control panel"); item.Keyboard(JavaKeyEvent.VK_ENTER); }
public static void OpenExePath(JavaOMI omi, string pathWithExe) { omi.WindowCommand(START + string.Format(" \"{0}\"", pathWithExe)); }
public static void CallCaptureScreen(JavaOMI omi) { omi.SendShortcutCommands("Shift↓ Window↓ S↕ Window↑ Shift↑"); }