views:

433

answers:

3

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 till my message box is dismissed.

How?

+1  A: 

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.

Nir
A: 

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

Vulcan Eager
A: 

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.

titanae