chencc77
asked on
execute a class Before Window is shutting down
Hi, as question title, how do i execute a class before Window is shutting down? Can i do that? Thanks
ASKER
Hi, I don't mean my java program can shut down the pc. But the program itself only auto execute when the pc is going to shut down.
From Java im not sure. You will need to register an interest with the system for an on shutdown event. Check the Microsoft Java API, but i doubt there will be anything there. Failing that look up on MSDN (msdn.microsoft.com) about registering an interest in system shutdown event. Then you will need to write some jni code that watchs for a system shutdown and passes on the information to the Java code.
(Assuming you are talking about Windows that is)
GR.
(Assuming you are talking about Windows that is)
GR.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i see. Thanks googlyralph. ^-^
If the JVM is running all the time, the go for Objects idea.
GR.
GR.
listening...
ASKER
Thanks, it works.
GR.