Allen
2005-07-26 09:10:53 UTC
I am trying to capture the filename from a dragged/dropped file into a
list control. I have read every single Tutorial, How-To and other
documentation I can find and I still can't get it to work. The drag
procedure works properly (the application captures it) but the filename
is passed as complete gibberish characters. As a test, I have been
tryingto get the name to display in either a list box or a message box.
I am using Windows XP and Dev-CPP.
Here is the source:
case WM_DROPFILES:
{
HDROP hdrop2;
TCHAR anewname[256];
DragQueryFile(hdrop2,0, anewname,
256);//sizeof(anewname));
SendMessage(hListBox,LB_ADDSTRING,0,(LPARAM)TEXT(anewname));
MessageBox(hwnd,anewname, "Dropped File:", MB_OK );
DragFinish(hdrop2);
}
list control. I have read every single Tutorial, How-To and other
documentation I can find and I still can't get it to work. The drag
procedure works properly (the application captures it) but the filename
is passed as complete gibberish characters. As a test, I have been
tryingto get the name to display in either a list box or a message box.
I am using Windows XP and Dev-CPP.
Here is the source:
case WM_DROPFILES:
{
HDROP hdrop2;
TCHAR anewname[256];
DragQueryFile(hdrop2,0, anewname,
256);//sizeof(anewname));
SendMessage(hListBox,LB_ADDSTRING,0,(LPARAM)TEXT(anewname));
MessageBox(hwnd,anewname, "Dropped File:", MB_OK );
DragFinish(hdrop2);
}