Handling Handles!

Started by
5 comments, last by Xeile 19 years, 6 months ago
MS Visual C++ 6.0 With my program I'm trying to get a filehandle. Oke, I drop a file from Windows Explorer on my program window. I receive the message ID 563 which is thrown on the WM_DROPFILES event. The parameters: wParam = 'some value' lParam = 0 (as it should be). Now my question is, what to do with the value wParam give me? How do I use it?
Advertisement
...
WM_DROPFILES on MSDN
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Well, I believe the return is a drop handle (HDROP) if I remember right. The drop handle should be able to return file strings by index using DragQueryFile (giving a 0xFFFFFFFF index will give you the count of the dragged files). Querying by index will give you the file name, then you go from there.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
I still don't quite get it. Here is a sample:

case WM_DROPFILES:
//DragFiles( hWnd, wParam ); // A user-def function
HDROP hDrop;
hDrop = wParam;
return 0;

Ok assigning wParam does not work, cause hDrop is a HDROP structure and wParam an unsigned integer.

How can use the value of wParam again?
Did you try converting it?

HDROP hDrop;
hDrop = (HDROP)wParam;
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Handles are just integers that go someplace.

You need to cast the wParam to an HDROP.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Now I get it. Thank you both. I didn't know that I had to convert it with the (HDROP)wParam statement, Extrarius provided.

I think I have a lift-off now. Thanks.

This topic is closed to new replies.

Advertisement