Constraining Drag & Drop

  • Thread starter Thread starter Evan Stone
  • Start date Start date
E

Evan Stone

Is there a way that I can constrain my drag-n-drop operations from my app to
a single target application?

It was remarkably easy to get the drag-n-drop functionality going in the
first place, but I'd like to only allow people to drag items from my
application *only* to Word (for example), and not to other applications, and
I was wondering if that was even possible...

Thanks!

Evan Stone
Petaluma, CA, USA
 
I don't know about only to word, but if you support only 'non-standart'
format, only your apps will be able to drag & drop between each others...
 
Evan said:
Is there a way that I can constrain my drag-n-drop operations from my app
to
a single target application?

It was remarkably easy to get the drag-n-drop functionality going in the
first place, but I'd like to only allow people to drag items from my
application only to Word (for example), and not to other applications, and
I was wondering if that was even possible...

I don't think it is. As Lloyd suggests, you could restrict the formats
that your application makes available, but I don't think there's a way to
restrict the target application. Certainly not an easy one... maybe you
could somehow, while a clipboard format is being requested, find out which
application you're talking to. I'm not sure that would work though, and it
would probably be extremly easy to work around if someone wanted to get
hold of the data that you intended to be only for Word - like rename
another app to winword.exe.


Oliver Sturm
 
I don't think it is. As Lloyd suggests, you could restrict the formats
that your application makes available, but I don't think there's a way to
restrict the target application.

That's sort of what I figured, but I thought I'd better ask the question
nonetheless... ;)

But seriously, trying to come up with an overly-complex solution to a
problem that really isn't that big of a deal to begin with would probably
just be overkill in the long run. I was just hoping there was something
simple that I was overlooking (which is usually the case).

The data that would be dropped on Word would not even be that useful in
other application contexts anyway, so in a discussion I had with someone
this morning, we came to the conclusion, "who cares where they drop it?"
(especially in a v1 product...)

Thanks for your help, guys!

evan k. stone
 
Back
Top