WM_DROPFILES Message
Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.
Syntax
PostMessage(
(HWND) hWndControl, // handle to destination control
(UINT) WM_DROPFILES, // message ID
(WPARAM) wParam, // = (WPARAM) (HDROP) hDrop;
(LPARAM) lParam // = 0; not used, must be zero
);
Parameters
hDrop
A handle to an internal structure describing the dropped files. Pass this handle DragFinish, DragQueryFile, or DragQueryPoint to retrieve information about the dropped files.
lParam
Must be zero.
Return Value
An application should return zero if it processes this message.
Remarks
The HDROP handle is declared in Shellapi.h. You must include this header in your build to use WM_DROPFILES. For further discussion of how to use drag-and-drop to transfer Shell data, see Transferring Shell Data Using Drag-and-Drop or the Clipboard.
Address:http://msdn.microsoft.com/en-us/library/bb774303(VS.85).aspx
===========
void CTestdragDlg::OnOK()
{
DROPFILES *lpDrg = NULL;
// CHAR lpBuffer[sizeof(DROPFILES) + MAX_PATH];
// ZeroMemory (lpBuffer,sizeof(DROPFILES) + MAX_PATH);
LPVOID lpBuffer = LocalAlloc(LPTR,sizeof(DROPFILES) + MAX_PATH);
if (lpBuffer)
{
lpDrg = (DROPFILES*) lpBuffer;
lpDrg->pFiles = sizeof(DROPFILES);
lstrcpyn((LPSTR)((DWORD)lpBuffer + sizeof(DROPFILES)),"c://abcd.txt",MAX_PATH);
SendMessage(WM_DROPFILES,(WPARAM)lpBuffer,0);
// LocalFree(lpBuffer);
}
}
据说QQ尾巴病毒是用这个……又据说可以一下填充多个文件……
MARK