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?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
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.
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.
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.
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.
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.
Alt+Ctrl+Del cannot be overridden. It is a security feature.