A finished application for public use by others hopefully no longer shows the toolbar so your question is not really relevant. 😉
Now you could use filering events for e.g. "Panel close?" to do a specific action and possibly ignore the panel close if needed.
You can also add your own "abort button", even make it graphically look the same, and trigger any desired action whenever it is pressed, including stopping the VI is desired.