using 开发辅助工具.Tools.SmartEditor; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace RySmartEditor { public class Init { public static void Show(string[] args) { if (args.Length >= 2) { if (args[0] == "edit") { string ProjectPath = args[1]; OpenEditor(ProjectPath); } } else if(args.Length == 1) { if (args[0] == "edit" || System.IO.File.Exists(args[0])) { OpenEditor(args[0]); } else { OpenEditor("edit"); } } else { OpenEditor("edit"); //Application.Run(new FrmMainEditor()); } } static void OpenEditor(string path) { object mainHandle = QuickMsg.RyMemoryShare.ReadFromMemory(1024, typeof(Int64), "SmartEditor"); if (mainHandle != null && (long)mainHandle != 0) { var handle = new IntPtr((long)mainHandle); if (path == "edit") { ryControls.Win32.SendMessage(handle, 17189, 100, 100);//让界面显示 } else { ryConfig.MsgManager.SendMsg(handle, 1666, path); } return; } else { Application.Run(new FrmMainEditor(path == "edit" ? "" : path)); } } } }