title: how to write code that capture shut down event with jna?
body: <p>I want to write a java application that hides in system tray and measures bandwidth traffic.
  I want before the PC shutdowns, to save traffic size to file.
  I use <code>shutdownHook</code> in <code>java</code> but it does not work.
  How to write code with <code>JNA</code> to call save function in my java code before PC shuts down?</p>