Determine the Pick Event

The pick event is the mouse action that starts a drag-and-drop operation with a call to DoDragDrop. You need to know what starts the operation in order to know what ends it, and you must know this to implement IDropSource::QueryContinueDrag.

Most often the pick event will be a WM_LBUTTONDOWN message about some meaningful point. As mentioned earlier, this can be anywhere in Cosmo's document window; only 8 pixels of it are visible around the outside of the Polyline figure. This is convenient because it eliminates any hit-testing. Therefore, Cosmo's pick event is any WM_LBUTTONDOWN message in the document window. We'll see how Cosmo detects this message and calls DoDragDrop later. But we have to implement and instantiate the object with IDropSource in order to call DoDragDrop.

Note: A source can use any mouse button for a pick event and can even combine the mouse action with the Alt key because you can detect changes in the state of any button and the Alt key within QueryContinueDrag in order to detect a drop event.