Attached is workspace EWX containing function <ewx> which demonstrates ExitWindowsEx.
(Based on VB code at http://vbnet.mvps.org/index.html?code/system/exitwindowsex.htm )