Drag 'n Drop Woes

M

MSNews

I have a problem with drag and drop. I am trying to drag something from
file explorer in windows XP to a listbox. The mechanism works and I use the
DragDrop event of the listbox to add the filenames to the list. This works
ok

However, The dragdrop effect is 'Move' as I have determined this. and I need
to inform the source that the paste has succeeded in order for it to update
the source file ( IE delete it ), because as it stands it will not delete
it.

Does anyone have any experience with this, offer a solution ?

TIA
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi MSNews,

In the DragDrop event do you set e.Effect = DragDropEffects.Move? This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and in this way
prevent the explorer to delete them?
 
M

MSNews

Thanks for your reply, but the first suggestion is ineffective as it is
already set to Move and the second guess is simply not the case.

Hope someone else can help !




Stoitcho Goutsev (100) said:
Hi MSNews,

In the DragDrop event do you set e.Effect = DragDropEffects.Move? This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and in this way
prevent the explorer to delete them?

--
HTH
B\rgds
100 [C# MVP]

MSNews said:
I have a problem with drag and drop. I am trying to drag something from
file explorer in windows XP to a listbox. The mechanism works and I use the
DragDrop event of the listbox to add the filenames to the list. This works
ok

However, The dragdrop effect is 'Move' as I have determined this. and I need
to inform the source that the paste has succeeded in order for it to update
the source file ( IE delete it ), because as it stands it will not delete
it.

Does anyone have any experience with this, offer a solution ?

TIA
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi MSNews,

Read here about CFSTR_PERFORMEDDROPEFFECT format

ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/sh
ell_basics/shell_basics_programming/transferring/clipboard.htm#CFSTR_PERFORM
EDDROPEFFECT
<Watch for line breaks>

And here the sections "Handling Optimized Move Operations" and maybe
"Handling Delete-on-Paste Operations"

ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/sh
ell_basics/shell_basics_programming/transferring/datascenarios.htm
<Watch for line breaks>

--
HTH
B\rgds
100 [C# MVP]

MSNews said:
Thanks for your reply, but the first suggestion is ineffective as it is
already set to Move and the second guess is simply not the case.

Hope someone else can help !




Stoitcho Goutsev (100) said:
Hi MSNews,

In the DragDrop event do you set e.Effect = DragDropEffects.Move? This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and in this way
prevent the explorer to delete them?

--
HTH
B\rgds
100 [C# MVP]

MSNews said:
I have a problem with drag and drop. I am trying to drag something from
file explorer in windows XP to a listbox. The mechanism works and I
use
the
DragDrop event of the listbox to add the filenames to the list. This works
ok

However, The dragdrop effect is 'Move' as I have determined this. and
I
need
to inform the source that the paste has succeeded in order for it to update
the source file ( IE delete it ), because as it stands it will not delete
it.

Does anyone have any experience with this, offer a solution ?

TIA
 
O

One Handed Man \( OHM#\)

Hi,
Thanks for those references, I was reading those early on in the day
yesterday. Unfortunately they were of little help because they were of a
general nature and were more pointed at C++ with no code examples.

I tried to use the "Performed DropEffect" and "Paste Succeeded" costants and
did a setData("Paste Succeeded") and setData("Performed DropEffect") to give
the source feedback, but this did not work.

Regards - OHM



Stoitcho Goutsev (100) said:
Hi MSNews,

Read here about CFSTR_PERFORMEDDROPEFFECT format

ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/clipboard.htm#CFSTR_PERFORM
EDDROPEFFECT
<Watch for line breaks>

And here the sections "Handling Optimized Move Operations" and maybe
"Handling Delete-on-Paste Operations"

ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/sh
ell_basics/shell_basics_programming/transferring/datascenarios.htm
<Watch for line breaks>

--
HTH
B\rgds
100 [C# MVP]

MSNews said:
Thanks for your reply, but the first suggestion is ineffective as it is
already set to Move and the second guess is simply not the case.

Hope someone else can help !




Stoitcho Goutsev (100) said:
Hi MSNews,

In the DragDrop event do you set e.Effect = DragDropEffects.Move? This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and in
this
way
prevent the explorer to delete them?

--
HTH
B\rgds
100 [C# MVP]

I have a problem with drag and drop. I am trying to drag something from
file explorer in windows XP to a listbox. The mechanism works and I use
the
DragDrop event of the listbox to add the filenames to the list. This works
ok

However, The dragdrop effect is 'Move' as I have determined this.
and
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi,

I found what the problem is and unfortunately there is nothing to do about
it. The problem is that when the framework receives an IDataObject via COM
from unmanaged application it wraps the COM IDataObject class with one
internal class called OleConverter. The bad thing is that the implementation
of the SetData method is empty. In other words calling DataObject.SetData
for CFSTR_PERFORMEDDROPEFFECT doesn't do anything, thus the explorer doesn't
get notified about the unoptimized move operation. So the only work arround
is to do optimized move.

--
HTH
B\rgds
100 [C# MVP]

One Handed Man ( OHM#) said:
Hi,
Thanks for those references, I was reading those early on in the day
yesterday. Unfortunately they were of little help because they were of a
general nature and were more pointed at C++ with no code examples.

I tried to use the "Performed DropEffect" and "Paste Succeeded" costants and
did a setData("Paste Succeeded") and setData("Performed DropEffect") to give
the source feedback, but this did not work.

Regards - OHM



Stoitcho Goutsev (100) said:
Hi MSNews,

Read here about CFSTR_PERFORMEDDROPEFFECT format
ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/clipboard.htm#CFSTR_PERFORM
EDDROPEFFECT
<Watch for line breaks>

And here the sections "Handling Optimized Move Operations" and maybe
"Handling Delete-on-Paste Operations"
ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/sh
ell_basics/shell_basics_programming/transferring/datascenarios.htm
<Watch for line breaks>

--
HTH
B\rgds
100 [C# MVP]

MSNews said:
Thanks for your reply, but the first suggestion is ineffective as it is
already set to Move and the second guess is simply not the case.

Hope someone else can help !




Hi MSNews,

In the DragDrop event do you set e.Effect = DragDropEffects.Move? This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and in this
way
prevent the explorer to delete them?

--
HTH
B\rgds
100 [C# MVP]

I have a problem with drag and drop. I am trying to drag
something
from
file explorer in windows XP to a listbox. The mechanism works and
I
use
the
DragDrop event of the listbox to add the filenames to the list. This
works
ok

However, The dragdrop effect is 'Move' as I have determined this.
and
I
need
to inform the source that the paste has succeeded in order for it to
update
the source file ( IE delete it ), because as it stands it will not
delete
it.

Does anyone have any experience with this, offer a solution ?

TIA
 
O

One Handed Man \( OHM#\)

Thanks


Stoitcho Goutsev (100) said:
Hi,

I found what the problem is and unfortunately there is nothing to do about
it. The problem is that when the framework receives an IDataObject via COM
from unmanaged application it wraps the COM IDataObject class with one
internal class called OleConverter. The bad thing is that the implementation
of the SetData method is empty. In other words calling DataObject.SetData
for CFSTR_PERFORMEDDROPEFFECT doesn't do anything, thus the explorer doesn't
get notified about the unoptimized move operation. So the only work arround
is to do optimized move.

--
HTH
B\rgds
100 [C# MVP]

One Handed Man ( OHM#) said:
Hi,
Thanks for those references, I was reading those early on in the day
yesterday. Unfortunately they were of little help because they were of a
general nature and were more pointed at C++ with no code examples.

I tried to use the "Performed DropEffect" and "Paste Succeeded" costants and
did a setData("Paste Succeeded") and setData("Performed DropEffect") to give
the source feedback, but this did not work.

Regards - OHM
ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/clipboard.htm#CFSTR_PERFORMms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/sh
ell_basics/shell_basics_programming/transferring/datascenarios.htm
<Watch for line breaks>

--
HTH
B\rgds
100 [C# MVP]

Thanks for your reply, but the first suggestion is ineffective as it is
already set to Move and the second guess is simply not the case.

Hope someone else can help !




Hi MSNews,

In the DragDrop event do you set e.Effect = DragDropEffects.Move? This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and
in
this
way
prevent the explorer to delete them?

--
HTH
B\rgds
100 [C# MVP]

I have a problem with drag and drop. I am trying to drag something
from
file explorer in windows XP to a listbox. The mechanism works
and
I this.
and
it
 
O

One Handed Man \( OHM#\)

I'm not using unmanaged code.



Stoitcho Goutsev (100) said:
Hi,

I found what the problem is and unfortunately there is nothing to do about
it. The problem is that when the framework receives an IDataObject via COM
from unmanaged application it wraps the COM IDataObject class with one
internal class called OleConverter. The bad thing is that the implementation
of the SetData method is empty. In other words calling DataObject.SetData
for CFSTR_PERFORMEDDROPEFFECT doesn't do anything, thus the explorer doesn't
get notified about the unoptimized move operation. So the only work arround
is to do optimized move.

--
HTH
B\rgds
100 [C# MVP]

One Handed Man ( OHM#) said:
Hi,
Thanks for those references, I was reading those early on in the day
yesterday. Unfortunately they were of little help because they were of a
general nature and were more pointed at C++ with no code examples.

I tried to use the "Performed DropEffect" and "Paste Succeeded" costants and
did a setData("Paste Succeeded") and setData("Performed DropEffect") to give
the source feedback, but this did not work.

Regards - OHM
ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/clipboard.htm#CFSTR_PERFORMms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/sh
ell_basics/shell_basics_programming/transferring/datascenarios.htm
<Watch for line breaks>

--
HTH
B\rgds
100 [C# MVP]

Thanks for your reply, but the first suggestion is ineffective as it is
already set to Move and the second guess is simply not the case.

Hope someone else can help !




Hi MSNews,

In the DragDrop event do you set e.Effect = DragDropEffects.Move? This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and
in
this
way
prevent the explorer to delete them?

--
HTH
B\rgds
100 [C# MVP]

I have a problem with drag and drop. I am trying to drag something
from
file explorer in windows XP to a listbox. The mechanism works
and
I this.
and
it
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi OHM,

I don't know if you are the same guy started the thread (MSNews) , but the
question was about dragging and droppping from windows explorer. There is
the unmanaged application. The COM IDataObjects targed receives is wrapped
up with that internal OleConverter and then on the targed site SetData
doesn't do anything.

However if you drag and drop form one managed application to another
everything's fine and you can use the SetData method and the source receives
those data.

--
B\rgds
100 [C# MVP]

One Handed Man ( OHM#) said:
I'm not using unmanaged code.



Stoitcho Goutsev (100) said:
Hi,

I found what the problem is and unfortunately there is nothing to do about
it. The problem is that when the framework receives an IDataObject via COM
from unmanaged application it wraps the COM IDataObject class with one
internal class called OleConverter. The bad thing is that the implementation
of the SetData method is empty. In other words calling DataObject.SetData
for CFSTR_PERFORMEDDROPEFFECT doesn't do anything, thus the explorer doesn't
get notified about the unoptimized move operation. So the only work arround
is to do optimized move.

--
HTH
B\rgds
100 [C# MVP]

One Handed Man ( OHM#) said:
Hi,
Thanks for those references, I was reading those early on in the day
yesterday. Unfortunately they were of little help because they were of a
general nature and were more pointed at C++ with no code examples.

I tried to use the "Performed DropEffect" and "Paste Succeeded"
costants
and
did a setData("Paste Succeeded") and setData("Performed DropEffect")
to
give
the source feedback, but this did not work.

Regards - OHM



Hi MSNews,

Read here about CFSTR_PERFORMEDDROPEFFECT format
ms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/transferring/clipboard.htm#CFSTR_PERFORMms-help://MS.MSDNQTR.2003FEB.1033/shellcc/platform/shell/programmersguide/sh
ell_basics/shell_basics_programming/transferring/datascenarios.htm
<Watch for line breaks>

--
HTH
B\rgds
100 [C# MVP]

Thanks for your reply, but the first suggestion is ineffective as
it
is
already set to Move and the second guess is simply not the case.

Hope someone else can help !




Hi MSNews,

In the DragDrop event do you set e.Effect =
DragDropEffects.Move?
This
should be enough for the expolorer to delete the files.
And My second quess - is it possible that you open the files and in
this
way
prevent the explorer to delete them?

--
HTH
B\rgds
100 [C# MVP]

I have a problem with drag and drop. I am trying to drag something
from
file explorer in windows XP to a listbox. The mechanism works
and
I
use
the
DragDrop event of the listbox to add the filenames to the
list.
This
works
ok

However, The dragdrop effect is 'Move' as I have determined this.
and
I
need
to inform the source that the paste has succeeded in order for
it
to
update
the source file ( IE delete it ), because as it stands it will not
delete
it.

Does anyone have any experience with this, offer a solution ?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top