예제 #1
0
 public static void Main()
 {
     NeathCopy.App app = new NeathCopy.App();
     app.InitializeComponent();
     app.Run();
 }
예제 #2
0
        public static void Main(string[] arguments)
        {
            //try
            //{
            #region Get ShellExt Arguments

            //for (int i = 0; i < arguments.Length; i++)
            //{
            //    MessageBox.Show(arguments[i]);
            //}

            //if (arguments != null && arguments.Length > 0)
            //{
            //    if (arguments[0] == "GET_ARGUMENTS")
            //    {
            //        var path = RegisterAccess.Acces.GetFilesListPath();
            //        //var writer = new StreamWriter(new FileStream(path, FileMode.Create, FileAccess.Write), Encoding.Unicode);

            //        var ope = arguments[1];

            //        //for (int i = 2; i < arguments.Length - 1; i++)
            //        //    writer.WriteLine(arguments[i]);

            //        //writer.Close();
            //        //writer.Dispose();

            //        var destiny = arguments[arguments.Length - 1];

            //        arguments = new string[] { ope, '*' + path, destiny };

            //    }

            //    //MessageBox.Show(arguments.Length.ToString());
            //}

            #endregion

            App myApp = new App();

            cmdShellAgent = new CmdShellExtAgent(arguments);

            if (cmdShellAgent.ArgumentsState == ArgumentsState.Valids)
            {
                //Fixing arguments
                requestInfo = cmdShellAgent.ProcessArguments();

                requestInfo.Content = RquestContent.All;

                //Set arguments to the Registry, so any other CopyHandle may know.
                RegisterAccess.Acces.SetLastArguments(requestInfo.Arguments);

                //Try add DataInfo'list to any copyHandler
                var res = VisualsCopysHandler.FindWindow(null, "VisualsCopysHandler");
                if (res != (IntPtr)0)
                {
                    VisualsCopysHandler.SendMessage((int)res, VisualsCopysHandler.WM_ADD_DATAINFO, (UIntPtr)0, (IntPtr)0);
                    Process.GetCurrentProcess().Kill();
                }
            }

            //MessageBox.Show("Hello NeathCopy");

            var nc = new VisualsCopysHandler();
            myApp.Run(nc);
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(Error.GetErrorLog(ex.Message, "NeathCopy", "StartupClass", "Main"));
            //}
        }