1

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?

4

3 回答 3

2

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.

于 2008-09-08T05:11:56.093 回答
0

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

于 2008-09-08T05:32:22.643 回答
0

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.

于 2008-09-08T06:29:20.650 回答