The third paragraph of the help (CVI2010) on Callback Function Schemes says:
The main callback function is the only type of callback function that responds to EVENT_END_TASK. This event occurs only under Windows when the user is trying to exit Windows.
This information appears to be incomplete: EVENT_END_TASK also occurs if the program is closed via the taskbar button.