Question

I need to display an error message on rejecting a drop in my application.

I tried this in the OnDrop() but then the source application hangs until my message box is dismissed.

How can I do that?

Was it helpful?

Solution

You can always call PostMessage with a private message in the WM_APP range and in the message handler show the error.

That way you show the error after the drag and drop operation is really over and there is no danger of messing up anything.

OTHER TIPS

You're right. But all the data I need to report in the message box is in the OnDrop.

If you need data you can copy it in the OnDrop, store it in some temporary location, then in the WM_APP range message pass the index to the data in temporary location. The handler for the WM_APP message can clean up the temporary data after showing the message box.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top