Prova a tradurre questo codice che hai scritto

codice:
if buttonSelected = mrOK then if not ExitWindows(EWX_POWEROFF or EWX_FORCE,0)
then if not buttonSelected = mrCancel then ShowMessage('Operazione Annullata');
end;
esprimendolo in lingua italiana.

A me non sembra molto chiaro...