I'm 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?? Regards, Kalle