Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to create HDROP?

710 views
Skip to first unread message

George

unread,
Mar 7, 2003, 12:17:50 AM3/7/03
to
How to create HDROP from DROPFILES and CF_HDROP ?
Needed for WM_DROPFILES.

Henk Devos

unread,
Mar 7, 2003, 6:42:56 AM3/7/03
to
The HDROP sis a memory handle. Call GlobalAlloc to create this handle,
GlobalLock to get a pointer to the memory where you can actually store the
data.

Henk Devos
http://www.whirlingdervishes.com

"George" <x...@no.com> wrote in message news:3E682B7E...@no.com...

George

unread,
Mar 7, 2003, 10:53:53 AM3/7/03
to
Are you sure about this? I've already called GlobalAlloc/GlobalLock when
I create CF_HDROP. HDROP is needed for WM_DROPFILES.

It's not hard to do that again, but what is the data structure?

On codeguru site, someone said HDROP is just a pointer, pointing to
a CF_HDROP handle. But I can't get it to work.

Thanks for the reply.

George

Joe

unread,
Mar 7, 2003, 2:22:16 PM3/7/03
to
George wrote:
> Are you sure about this? I've already called GlobalAlloc/GlobalLock when
> I create CF_HDROP. HDROP is needed for WM_DROPFILES.

For WM_DROPFILES, you *get* an HDROP, and use it in DragQueryFile to extract
the file names. You don't create an HDROP there.

>
> It's not hard to do that again, but what is the data structure?

<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/structures/dropfiles.asp>

>
> On codeguru site, someone said HDROP is just a pointer, pointing to
> a CF_HDROP handle. But I can't get it to work.

See above.

-Joe

George

unread,
Mar 7, 2003, 5:10:31 PM3/7/03
to Joe
Right, if I receive a WM_DROPFILES message.
But I want to send a WM_DROPFILES message to an exist window.

Your link point to DROPFILES/CF_HDROP structure, I've already
got that (see my original post). What I want is HDROP, not
CF_HDROP. Are you telling me their same thing?

Thanks for reply.

George

George

unread,
Mar 7, 2003, 5:14:56 PM3/7/03
to
Right, if I receive a WM_DROPFILES message.
But I want to send a WM_DROPFILES message to an exist window.
So that widnow can use HDROP in DragQueryFile.

Your link pointing to DROPFILES/CF_HDROP structure, I've already


got that (see my original post). What I want is HDROP, not

CF_HDROP. Are you telling me they're same thing?

Thanks for reply.

George

Joe

unread,
Mar 7, 2003, 6:39:35 PM3/7/03
to
George wrote:
> Right, if I receive a WM_DROPFILES message.
> But I want to send a WM_DROPFILES message to an exist window.
>
> Your link point to DROPFILES/CF_HDROP structure, I've already
> got that (see my original post). What I want is HDROP, not
> CF_HDROP. Are you telling me their same thing?

Yes.
HDROP is a global handle referring to a DROPFILES structure.
CF_HDROP is the *id* for an HDROP that is stored on the clipboard.

-Joe

George

unread,
Mar 8, 2003, 12:10:07 AM3/8/03
to

Joe wrote:
> HDROP is a global handle referring to a DROPFILES structure.

cool. that's easy.

> CF_HDROP is the *id* for an HDROP that is stored on the clipboard.

how do i get this *id*?

thank you very much for you help.

Axel Sommerfeldt

unread,
Mar 9, 2003, 5:30:39 AM3/9/03
to
George <x...@no.com> wrote:

>> CF_HDROP is the *id* for an HDROP that is stored on the clipboard.
>
> how do i get this *id*?

It's defined in WinUser.h:

#define CF_HDROP 15

Regards,
Axel

Chris Guzak [MS]

unread,
Mar 9, 2003, 2:15:26 PM3/9/03
to
you need to implement OLE drag and drop to communicate an HDROP to other applications. the WM_DROPFILES is from Win3.1 days and there is no way to be a source of that message.
 
check out this article on how to do data transfer.
 
 
Chris Guzak
standard disclaimer
 
"George" <x...@no.com> wrote in message news:3E6919E...@no.com...

George

unread,
Mar 9, 2003, 3:56:07 PM3/9/03
to Chris Guzak [MS]
Thanks, but I'm try to avoid ole. It's hard to use in C. And it's
overkill for me. I just want a simulate drag & drop, no cursor move
at all. I know which file to drag, and where to drop. I don't want
the drag & drop process. I only care the result: a file dropped at
the position I want. Any suggestion?

Henk Devos

unread,
Mar 9, 2003, 6:22:48 PM3/9/03
to
There IS a way to send this message.
Look at the WM_DROPFILES definition to see what arguments the message takes.
The HDROP is really a HGLOBAL that contains the DROPFILES struct.
The message handling will copy the memory into a different process's memory
space if necessary.
But the WM_DROPFILES method is certainly not the preferred way of doing
this. Use OLE drag and drop if possible. One of the advantages is that you
will get much better visual feedback.


"George" <x...@no.com> wrote in message news:3E6BAA67...@no.com...

0 new messages