日期:2014-05-20  浏览次数:20799 次

一个比较难的问题!!!
用JAVA写了一个程序,怎么捕获系统要关机的命令
并在关机前提示用户一些信息

------解决方案--------------------
确实难,没接触过,顶
------解决方案--------------------
MARK
------解决方案--------------------
不懂,顶
------解决方案--------------------
用JNI调用C++来实现,C++来捕获系统要关机的命令是比较容易的。

------解决方案--------------------
出自:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4796976

Bug ID: 4796976
Votes 9
Synopsis RFE: Users cannot veto shutdown process in Windows
Category java:classes_awt
Reported Against 1.4.1
Release Fixed
State In progress, request for enhancement
Related Bugs
Submit Date 20-DEC-2002
Description


FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java Hotspot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

FULL OPERATING SYSTEM VERSION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
Applications running under Windows receive the
WM_QUERYENDSESSION message when a user wants to logoff or
shutdown Windows. Applications can veto the shutdown by
returning FALSE to this message.

In response to this message, most desktop applications
show a dialog to the user for dirty documents allowing
users to save their work or cancel the shutdown.
……

----------------------------------------
呵呵,早就有人抗议了,但是“In progress, request for enhancement”,等吧。