Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1997-05-20
4
Medium Priority
?
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 100 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

609 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