I am trying to implement paste functionality for an application. I am
having a problem distinguishing how data of the format CF_HDROP was
placed on the Clipboard. How do I determine if the file data on the
clipboard was set with a "Cut" or a "Copy" operation? For instance, I
would like my Paste operation to determine if a user Cut a file to the
clipboard with Explorer, so that I can do a file system move operation
during the paste, rather than a copy.
Thanks for any information and help.
Carlin
I think it is the responsibility of the Source application (the
application which supplies the data in a D&D operation) to delete the
data (in your case, Explorer). Your app shouldn't get involved. This
is controlled using the DROPEFFECT_ return values of OLE drag and drop.
--
David Ching, Windows Consultant
DC Software Design, Inc.
http://www.dcsoft.com
Thanks for the help. I appreciate your time and the information you shared.
I have already successfully implemented the D&D functionality you described.
However, the paste operation I am having a problem with is related to
keyboard accelerators (^X, ^C, ^V), drop down menus and context menus with
edit options for cut, copy, and paste. For instance. a user selects the
paste option from one of my drop down menus. I then find that data, a file,
of format CF_HDROP exists on the clipboard. However, how did it get there?
Cut or Copy? As the target app, if it is not my responsibility to remove
data from the source location, how does the source know I have completed the
Paste operation?
Again, thanks for your help.
Carlin
> Carlin Rogers wrote:
> >
> > Hi,
> >
> > I am trying to implement paste functionality for an application. I am
> > having a problem distinguishing how data of the format CF_HDROP was
> > placed on the Clipboard. How do I determine if the file data on the
> > clipboard was set with a "Cut" or a "Copy" operation? For instance, I
> > would like my Paste operation to determine if a user Cut a file to the
> > clipboard with Explorer, so that I can do a file system move operation
> > during the paste, rather than a copy.
> >
>
> I think it is the responsibility of the Source application (the
> application which supplies the data in a D&D operation) to delete the
> data (in your case, Explorer). Your app shouldn't get involved. This
> is controlled using the DROPEFFECT_ return values of OLE drag and drop.
>
I'm having the same problem. The STGMEDIUM structure returned for CF_HDROP
has no DROPEFFECT information - only an IUnknown pointer (and that is NULL).
The source application is not receiving notification that I have Paste'd.
I suspect that CF_HDROP is the wrong data type to be using, but I don't
know what the right type may be.
The solution presented is MFC specific, but can be wrangled to be WIN32 only
with some effort. In any event, there's a pretty good explanation of UDT
objects, etc.
Herb.
"The liberties of our country, the freedom of our civil Constitution, are
worth defending at all hazards." - Samuel Adams