コード例 #1
0
        //DA Process was removed.
        static void monitor_Attached(object sender, EventArgs e)
        {
            Console.WriteLine("monitor_Attached(object sender, EventArgs e)");
            //create a new client class for this DA Process
            var client = new Client();

            //prepare ETDA.dll and inject it into the process.
            client.InitializeMemory(
                System.Diagnostics.Process.GetProcessById((int)sender),
                Path.Combine(Environment.CurrentDirectory, "EtDA.dll"));

            //Add to our Global collections dictionary.
            Collections.AttachedClients[(int)sender] = client;

            InjectCodeStubs(client);

            _parentForm.Invoke((MethodInvoker) delegate()
            {
                //invoke OnAttached, so signal creation of Packet Handlers.
                client.OnAttached();
            });
        }