gpt4 book ai didi

c++ - 如何在 Windows 上使用 C++ 模拟 Ctrl+C 组合

转载 作者:行者123 更新时间:2023-11-28 07:50:48 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Can I send a ctrl-C (SIGINT) to an application on Windows?
How to effectively kill a process in C++ (Win32)?
C++ Sending a simple signal in Windows

我有一个 java 控制台应用程序,当我按下 CTRLC 时,该应用程序开始关闭。你能告诉我,如果我只知道 pid 并且有进程 handle,我如何从我的 C++ 应用程序模拟按下 CTRLC

据我了解,我必须发送 SIGINT要处理的信号,我该怎么做?

附注SO 上的解决方案不起作用!

谢谢!

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com