I have an external application that calls my application and is supposed to end it when the job is done. The log from this external application claims it uses WM_CLOSE
WM_CLOSE
You must create hidden window using winapi, and handle WM_CLOSE message in its message loop. Is your app using any gui elements?