我在应用程序中使用FFmpeg,它可以完美地启动和录制视频 但是当我想要停止它请求按" q"时,我收到了System.EntryPointNotFoundException错误消息。
我如何发送消息" q"处理从应用程序运行状态
int key_q = 81;
[DllImport("user32.dll", EntryPoint = "postmessage")]
private static extern bool postmessage(IntPtr hwnd, uint msg, int wparam, int lparam);
private void button_stop_Click(object sender, EventArgs e)
{
string process = "ffmpeg";
Process[] pro = Process.GetProcessesByName("ffmpeg");
pro[0].Refresh();
IntPtr h = pro[0].MainWindowHandle;
postmessage(h, 0x100, key_q, 0);
}