Board index » delphi » Drag'n'drop

Drag'n'drop

Hi!

I wanted to enable my app to accept external files dragged on its
surface (like you can drag and drop doc files into word, etc). I called
the "DragAcceptFiles" function (from shell32.dll) as follows:

{definition of the proc header}
procedure DragAcceptFiles(Handle:Integer; Accept:Boolean); external
'shell32.dll' name 'DragAcceptFiles';
...
{function call. mainform already exists}
DragAcceptFiles(form1.handle,true);
{where form1 is the mainform of my app}

There was no errormessage, it just didn't work. I tried "WordBool"
instead of "Boolean" in the proc header def statement as well, no
effect.

Pleaaase help me!

Thilo.

P.S.:Merry christmas, a happy new year and *%@?&!ing WinAPI
documentation!

 

Re:Drag'n'drop


Ok Ok Ok!

I found the answer myself. I didn't know about any calling conventions and
the stdcall directive. It works only with the stdcall thing.

procedure DragAcceptFiles(Handle:Integer; Accept:Boolean); stdcall;
external 'shell32.dll';

Quote
Kauschke wrote:
> Hi!

> I wanted to enable my app to accept external files dragged on its
> surface (like you can drag and drop doc files into word, etc). I called
> the "DragAcceptFiles" function (from shell32.dll) as follows:

> {definition of the proc header}
> procedure DragAcceptFiles(Handle:Integer; Accept:Boolean); external
> 'shell32.dll' name 'DragAcceptFiles';
> ...
> {function call. mainform already exists}
> DragAcceptFiles(form1.handle,true);
> {where form1 is the mainform of my app}

> There was no errormessage, it just didn't work. I tried "WordBool"
> instead of "Boolean" in the proc header def statement as well, no
> effect.

> Pleaaase help me!

> Thilo.

> P.S.:Merry christmas, a happy new year and *%@?&!ing WinAPI
> documentation!

Re:Drag'n'drop


Quote
In article <36850793.620B1...@T-Online.DE>, Kauschke wrote:
> I wanted to enable my app to accept external files dragged on its
> surface

By the way, if you want a lot more control over the process, and you want to
handle drag and drop of a host of other types of data, take a look at the URLs
in my signature.

--
Sun, 27 Dec 1998 21:48 EST
Jim O'Brien, UnitOOPS Software   unito...@remove-this-prefix.unitoops.com
Check out our OLE Drag and Drop Components at http://www.unitoops.com/
Browse examples online at <http://www.unitoops.com/uoole/examples/>

Other Threads