on shutdown clear events && set up the shutdown handler _screen.BackColor = 255 read events && go into the event loop * this code won't execute until the window X button is clicked or closed from the taskbar button _screen.BackColor = rgb( 0, 0, 255 ) Messagebox( "on my way outta here" ) on shutdown && you have to clear the shutdown handler out of the system _screen.BackColor = rgb( 0, 255, 0 ) return && back to the O/S we go>I am trying to retrieve the wParam from the tagMSG structure of Windows API GetMessage to detect the SC_CLOSE value sent when the user selects "Close CtrL+F4" from the Windows system title bar menu. However, I can not detect any form event that fires when the user opens that menu, scrolls down to the close option, and presses the "Enter" key.