/// <summary> /// Tries to activate the other process /// </summary> private static bool Activate(String appName) { #if !MONO ApplicationInfo info = GetApplicationInfo(appName); if (info != null) { NativeWindowMethods.SwitchToThisWindow(info.WindowHandle, false); return(true); } else #endif { return(false); } }
/// <summary> /// Tries to load a project in another process and activate it. /// </summary> private static bool Activate(String appName, String projectName, string projectPath) { #if !MONO ApplicationInfo info = GetApplicationInfo(appName); if (info == null) { return(false); } if (info.LoadedProject != projectPath && !String.IsNullOrEmpty(projectName) && !String.IsNullOrEmpty(projectPath)) { if (!SendProjectLoadRequest(appName, projectName, projectPath)) { return(false); } } NativeWindowMethods.SwitchToThisWindow(info.WindowHandle, false); return(true); #else return(false); #endif }