我有这个恶作剧应用程序,我需要一种方法来终止它与键盘,因为它移动鼠标,我无法访问任务管理器运行时。我想用alt + p终止它。
drunkMouseThread.Start();
drunkKeyThread.Start();
drunkSoundThread.Start();
drunkPopupThread.Start();
//Where I need to kill it
bool setTrue = true;
while ( setTrue == true)
{
if (Keys.KeyCode == Keys.NumLock)
{
break;
}
Thread.Sleep(50);
}
//Kill all threads and exit the app
drunkMouseThread.Abort();
drunkKeyThread.Abort();
drunkSoundThread.Abort();
drunkPopupThread.Abort();