Disable the Ctrl-Alt-Delete event through Java pro

2019-02-22 11:00发布

I am creating a desktop application using the JDesktopPane. I'm almost complete, but when I press ctrl + alt + del, it leaves my application. How can I prevent that action?

6条回答
我想做一个坏孩纸
2楼-- · 2019-02-22 11:39

Fact is Alt+Ctrl+Del never actually entering your application. Os traps Alt+Ctrl+Del before it is send to your application. So you can't trap it.

查看更多
叼着烟拽天下
3楼-- · 2019-02-22 11:39

http://www.codeproject.com/KB/winsdk/AntonioWinLock.aspx

lists several possibilities, from disabling the taskmanager to injecting keyboard hooks. But I doubt there's some built-in java functionality for that.

查看更多
\"骚年 ilove
4楼-- · 2019-02-22 11:39

What I have done is add a temporary file to the startup folder and then using a forced sign out when they hit they hit control ALT delete in a shutdown hook. Also, I would set the GUI to alwaysOnTop. However, when they log back in make sure you delete the temp running file. This, way if they sign out and cancel it, they will not be able to, and the program will still run.

查看更多
欢心
5楼-- · 2019-02-22 11:40

You can disable the task manager by setting alwaysOnTop to true and when they signout have your program cancel the signout. However, there is nothing against powering off your machine.

查看更多
我只想做你的唯一
6楼-- · 2019-02-22 11:52

You cannot do that. The behavior of Alt+Ctrl+Del is enforced by the operating system, for good reasons: it makes sure that you can always bail-out of a faulty application.

查看更多
Explosion°爆炸
7楼-- · 2019-02-22 11:53

Alt+Ctrl+Del cannot be overridden. It is a security feature.

查看更多
登录 后发表回答