From: Dennis Misener Date: 2005-06-29T23:50:41+09:00 Subject: Detecting Windows Shutdown I needed to perform an orderly shutdown of a Webrick based Ruby application. I thought about trying to catch the WM_QUERYENDSESSION message which is sent to all programs when a request to shutdown Windows is made, in order to execute some code before Windows exits. Does anyone know how to do that in Ruby? Is it even possible?