On 10/18/2022 1:04 PM, Igor Korot wrote:
> I think SetEscapeId() is what you are looking for...
I think I need to re-think this. That would invoke the Close handler
which hides the dialog and ends the modal loop.
When the user hits my dialog's Stop Immediately button, the handler sets
a flag in the worker thread to tell it to exit at the next opportunity
rather than wait for a major operation to complete. (Each API call to
the hardware driver checks this flag.) The thread posts a "thread done"
event to the dialog, which then closes the window, hiding it and ending
the modal loop.
So I think I really want to intercept the Escape key as an ordinary key
and vector it away from the default Close handler.