🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7650

Re: How to Drag and Drop Text From Other Windows Application

#7650
From: Remy Lebeau (TeamB)
Date: Fri, 31 Dec 2004 03:45
23 lines
2126 bytes
"Jason" <nospam@here.com> wrote in message
news:Xns95CFDF0421A86nospamherecom@207.105.83.66...

>  I want to be able to select some text from anothe window program,
> such as word, and drag n drop on to my program, my program will
> be able to take that selected text in as a string.

The only way to do that is to use OLE Drag&Drop via the IDropTarget
interface.  You implement a class that is derived from IDropTarget, and then
register it with the OS using RegisterDragDrop().  Assuming the other
program also supports OLE Drag&Drop, it will implement its own class derived
from the IDropSource interface and pass that to the DoDragDrop() function
when the dragging begins.  When the dragged object is moved over your
registered window, your IDropTarget interface will be called.  You can then
query the provided IDataObject interface that is passed to your implemented
DragEnter() method, making sure the data is acceptable to you.  If it is,
then when the drag is finished, your implemented Drop() method will be
called to extract the data from the IDataObject and then use the data as
needed.


Gambit
Technical Details
Message-ID: <41d4cafc@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <Xns95CFDF0421A86nospamherecom@207.105.83.66>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,21c243e5d1d12c2e
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <Xns95CFDF0421A86nospamherecom@207.105.83.66>
Subject: Re: How to Drag and Drop Text From Other Windows Application
Date: Thu, 30 Dec 2004 19:45:16 -0800
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <41d4cafc@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1104464636 68.69.17.41 (30 Dec 2004 19:43:56 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail