Partager via


CWnd::DragAcceptFiles

Call this member function from within a window, using a CWnd pointer, in your application's CWinApp::InitInstance function to indicate that the window accepts dropped files from the Windows File Manager or Windows Explorer.

void DragAcceptFiles(
   BOOL bAccept = TRUE 
);

Parameters

  • BAccept
    Flag that indicates whether dragged files are accepted.

Remarks

Only the window that calls DragAcceptFiles with the bAccept parameter set to TRUE has identified itself as able to process the Windows message WM_DROPFILES. For example, in an MDI application, if the CMDIFrameWnd window pointer is used in the DragAcceptFiles function call, only the CMDIFrameWnd window gets the WM_DROPFILES message. This message is not sent to all open CMDIChildWnd windows. For a CMDIChildWnd window to receive this message, you must call DragAcceptFiles with the CMDIChildWnd window pointer.

To discontinue receiving dragged files, call the member function with bAccept set to FALSE.

Requirements

Header: afxwin.h

See Also

Reference

CWnd Class

Hierarchy Chart

DragAcceptFiles

WM_DROPFILES

Concepts

CWnd Members