private void btnStartClient_Click(object sender, EventArgs e) { if (SpawnCaveStoryProcess()) { Ninjector.Ninjector dllInjector = new Ninjector.Ninjector(); IntPtr injectionPointer = IntPtr.Zero; System.Diagnostics.Process doukutsuProcess = System.Diagnostics.Process.GetProcessesByName("Doukutsu")[0]; try { dllInjector.Inject(doukutsuProcess, "DoukutsuNetto_Client.dll", out injectionPointer); if (injectionPointer == IntPtr.Zero) // injection not successful { } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Error starting Cave Story (is Doukutsu.exe in the same directory?)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }