in reply to How to trap logoff

You'd use Win32::GUI's Hook method and provide a callback (or maybe even use Win32::API to wrap your own hook), or you'd use Wx and provide a wxApp::OnQueryEndSession/wxApp::OnEndSession.

If you're using Win32::DAEMON, you should use RegisterCallbacks ...

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.