in reply to 'Gracefully' closing a win32 app

Using Win32::API, use the SendMessage (or PostMessage) API call, and send the message WM_CLOSE to its main window; or maybe, use the PostQuitMessage API call instead. I'm a bit iffy on the details, but you can read up on them on Microsoft's MSDN website.