2 out of 3 rated this helpful - Rate this topic

DragAcceptFiles function

Applies to: desktop apps only

Registers whether a window accepts dropped files.

Syntax

VOID DragAcceptFiles(
  HWND hWnd,
  BOOL fAccept
);

Parameters

hWnd

Type: HWND

The identifier of the window that is registering whether it will accept dropped files.

fAccept

Type: BOOL

A value that indicates if the window identified by the hWnd parameter accepts dropped files. This value is TRUE to accept dropped files or FALSE to discontinue accepting dropped files.

Return value

No return value.

Remarks

An application that calls DragAcceptFiles with the fAccept parameter set to TRUE has identified itself as able to process the WM_DROPFILES message from File Manager.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Shellapi.h

Library

Shell32.lib

DLL

Shell32.dll (version 4.0 or later)

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
UAC
You will need to add WM_DROPFILES and WM_COPYGLOBALDATA to message filter (ChangeWindowMessageFilter), if you want to drag files from non-elevated applications to yours (elevated).
C# syntax
[DllImport("shell32.dll", CharSet=CharSet.Ansi, ExactSpelling=true)]
public static extern void DragAcceptFiles(HandleRef hWnd, bool fAccept);
vb.net syntax
<DllImport("shell32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)> Public Shared Sub DragAcceptFiles(ByVal hWnd As HandleRef, ByVal fAccept As Boolean)
End Sub