Make X button exit Macro ?

Hi,
I just stumbled across something a little annoying to me. The Xbutton in the top right corner of a form does not exit the macro itjust exits the form and continues to run the rest of the macro. Canyou make the the button exit the macro ? I know I could just make acancel button but I am just wondering if it works.
Thanks.SolidworksApi macros