退出隐藏的控制台应用

时间:2014-09-08 05:22:19

标签: c# console-application

我有这个恶作剧应用程序,我需要一种方法来终止它与键盘,因为它移动鼠标,我无法访问任务管理器运行时。我想用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();

1 个答案:

答案 0 :(得分:0)

我希望以下网址可能对您有用 source 1Processing Global Mouse and Keyboard Hooks in C#