You know, if you create a message box by AfxMessageBox(...)
function, you might aware of that, the function do not return until user clicks the appropriate button e.g. Cancel, OK, Yes, No... etc.
It seems the function waits until user presses a button instead of returning a value. A function completes execution usually in a few miliseconds. But its unusual for a function to wait for an unlimited time.
I have thought about it, but got no idea on how to do that.

Would you please share, if you have any idea.