E9 BPM: Prevent user from clicking on "X" to close the Eng. Workben


I've put a pre-processing method directive on EngWorkBench.GroupUnLock with no conditions, and the error message box from PublishEx.i below does display as it should, but after clicking "OK" on the error message box, it allows the Engineering Workbench application window to close. All of my other BPMs using PublishEx.i prevent further processing. This is the only method in the trace. I've tried both PublishEx.i constructs below. Any ideas before I start doing shots?

/* Do not allow user to close the Workbench window (by clicking "X") if they have checked-out revisions and the group has not been closed. */

Define variable MyErrorMsg as character no-undo.
assign MyErrorMsg = ''.

find first ecogroup where ecogroup.company = cur-comp and ecogroup.groupid = ipGroupID and ecogroup.groupclosed = false no-lock no-error.
if available ecogroup then do:
find first ecorev where ecorev.company = cur-comp and ecorev.groupid = ipGroupID and ecorev.checkedout = true no-lock no-error.
if available ecorev then do:
assign MyErrorMsg = 'There are checked-out items in this Group -- you cannot exit while items are still checked-out.' + chr(10) + chr(10).

/*{lib\PublishEx.i &exMsg = MyErrorMsg} {&THROW_PUBLIC}. */
{lib/PublishEx.i &exMsg = MyErrorMsg &ExType = {&MESSAGE_ERR}}