Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag'n'Drop Files 1

Status
Not open for further replies.

PatBcn

Programmer
Jun 5, 2000
3
ES
When droping a file within a CDialog correctly defined as an accept files window I get the event when I drop the file in my window (by defining the function OnDropFile(HDROP hDropInfo) and the message hendler WM_ONFILEDROP), but...
how can I get the name of the file -or files-? Where can i get a description of this HDROP structure?
I just get the event, but can't get the file.

Thanks a lot
Toni
 
Dear Toni,

You want to look at the WIN32 API DragQueryFile().

Good luck
-pete
 
Works perfect while dropping files into a CDialog. Thanks!!
Now I am trying to drop files into the application's icon to open them.
I tried these two methods:
1- With the member variable of CWinApp "m_lpCmdLine"
2- With the MFC functions:
CCommandLineInfo ComandLine;
ParseCommandLine(ComandLine);
ComandLine.m_strFileName
The problem in both cases is that I don't get UNICODE strings. I don't get the right names, so I can't open the files. I tried with the Api GetCommandLine(...) but returns just the program name (using UNICODE)
Some ideas?? Thanks
Toni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top