I like to close application via an API call.

I think it is possible using the PostMessage API, but all examples use WM_Close, for example:

RetVal = PostMessage(winHwnd, WM_CLOSE, 0&, 0&)

This always results in immediatly closing the application without the form_QueryUnload and form_unload events taking place.

So unfinished business stays unfinished.

The application I like to close needs to have the ability to reject my request to close it. Hence I need the Query_unload event.

Thanks for answer.