static void TestCreateProcessWithDll(string cmdLine, string dllName) { DeviareLiteInterop.HookLib.STARTUPINFO si; DeviareLiteInterop.HookLib.ProcessInfo pi; MessageBox.Show("Launching CALC with a DLL injected\r\r(close Calc to next test)", "Dll Inject Test", MessageBoxButtons.OK); try { si = new DeviareLiteInterop.HookLib.STARTUPINFO(); pi = cHook.CreateProcessWithDll(cmdLine, "", null, null, false, 0, null, null, si, dllName); WaitForSingleObject(pi.procHandle.DangerousGetHandle(), 0xFFFFFFFF); } catch (Exception ex) { MessageBox.Show("Couldn't complete operation\r\rError: " + ex.ToString(), "Dll Inject Test", MessageBoxButtons.OK, MessageBoxIcon.Error); } }