Solved

File Manager Drag and Drop to a VB4 form in NT3.51

Posted on 1997-05-20
4
212 Views
Last Modified: 2012-06-27
How do I get a VB4 form to accept drag and drop files from the file manager and then retrieve the filenames. I could do this in VB3 in Win 3.11 but the method doesn't work in VB4 and NT3.51.

The API calls DragAcceptFiles, DragQueryFiles and DragFinish turn on draggin and dropping, allow the filenames to be retrieved and stop dragging and droping respectively. But how do I detect the drop event (and how do I know my form was the one dropped on)?
0
Comment
Question by:coons
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:tward
ID: 1426431
Try the following API calls:

DragAcceptFiles, DragFinish: Support File Manager drag/drop file ability.

I haven't had time to get them to work yet but here are some declarations:

Declare Sub DragAcceptFiles Lib "shell32.dll" Alias "DragAcceptFiles" (ByVal hwnd As Long, ByVal fAccept As Long)

Declare Function DragDetect Lib "user32" Alias "DragDetect" (ByVal hWnd As Long, ByVal pt As POINTAPI) As Boolean

Declare Sub DragFinish Lib "shell32.dll" Alias "DragFinish" (ByVal hDrop As Long)

Declare Function DragObject Lib "user32" Alias "DragObject" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal un As Long, ByVal dw As Long, ByVal hCursor As Long) As Long

Declare Function DragQueryFile Lib "shell32.dll" Alias "DragQueryFileA" (ByVal HDROP As Long, ByVal UINT As Long, ByVal lpStr As String, ByVal ch As Long) As Long

Declare Function DragQueryPoint Lib "shell32.dll" Alias "DragQueryPoint" (ByVal HDROP As Long, lpPoint As POINTAPI) As Long
0
 

Author Comment

by:coons
ID: 1426432
Edited text of question
0
 

Author Comment

by:coons
ID: 1426433
How do I detect the drop event (see new question text)?
0
 
LVL 7

Accepted Solution

by:
tward earned 50 total points
ID: 1426434
The only way that I have seen is through a program that can hook into the messages.  You have to trap the WM_DROPFILES Message.  There are several Shareware OCX's that hook into the messages.  One that comes to mind is Message Blaster.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question