How to Ole Drag/Drop image files to a 3rd party program?

Posted on 2002-06-20
Last Modified: 2010-05-02
On a VB6 form I have a File1 control listing multiple .JPG files.  In File2 on the same form I have a 3rd party image printing program that will accept OleDragDrop (I've tested it with Explorer, dropping up to five images on it).

I would like to multiselect files from File1 then drag them to the .EXE shown in File2 and drop them, which should have the same effect as working within Explorer, launching the program with the files loaded inside.

It seemed simple until I began and now I need lots of help.


The process I need to do is to drag and drop multiple files onto a 3rd party program so that the 3rd party program accepts the files and launches.

This would be similar to having two instances of Explorer open, one pointing to a folder with .JPG files in it and the other instance pointing to a 3rd party .JPG printing program.  Another example would be one Explorer showing .BMP's and the other Explorer showing MS Paint.  Click and drag the .BMP and drop it on the MS Paint program and it will not only launch MS Paint but MS Paint will have the .BMP displayed when it is opened.

I am attempting to do this with a more friendly interface than two instances of Explorer, using the VB Controls File1 and File2.

Is it possible to have two instances of Explorer (like a control) within my VB6 project so that the drag and drop onto them and thereby the 3rd party program would be automatic?

Can anybody help?
Question by:rrorison
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
LVL 16

Expert Comment

ID: 7097780
i have something...let me see...

Expert Comment

ID: 7098706
Take a look here.
This might help you code for your requirement.
LVL 16

Expert Comment

ID: 7098872
try this (it was done with a picture box so you have to do some changes):

Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   3600
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6180
   LinkTopic       =   "Form1"
   ScaleHeight     =   3600
   ScaleWidth      =   6180
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1
      Caption         =   "&Select folder"
      Height          =   435
      Left            =   4380
      TabIndex        =   2
      Top             =   3060
      Width           =   1635
   Begin VB.FileListBox File1
      Height          =   2820
      Left            =   60
      Pattern         =   "*.jpg"
      TabIndex        =   1
      Top             =   120
      Width           =   2475
   Begin VB.PictureBox Picture1
      AutoSize        =   -1  'True
      Height          =   2775
      Left            =   2700
      ScaleHeight     =   2715
      ScaleWidth      =   3315
      TabIndex        =   0
      Top             =   120
      Width           =   3375
   Begin VB.Label Label1
      AutoSize        =   -1  'True
      Height          =   195
      Left            =   2160
      TabIndex        =   3
      Top             =   3600
      Width           =   480
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()

With File1
    .Path = BrowseForFolder(Me.hWnd, "")
    .Pattern = "*.jpg;*.gif"
End With
End Sub

Private Sub File1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Label1
    .Caption = File1.Path & "\" & File1.FileName
    .Drag vbBeginDrag
End With
End Sub

Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single)
Picture1.Picture = LoadPicture(Label1.Caption)
End Sub
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 7105348


To rpai:

While the link you provided did indeed have notations regarding drag and drop as a process on a VB project, the referenced link focused primarily on image to image controls.  My original question asked for help regarding multiple image files and ole drag and drop to a 3rd party software program.

To Richie_Simonetti:

As I noted above, my original question did not refer to ole drag and drop from the File1 control to an image control, but for multiple image files being dropped onto a software program, File1 to File2 and have that program launched.

At this time I am requesting to have this question removed so no further Comments or Suggestions should be registered.

My thanks to those who spent time to provide these suggestion.
LVL 16

Expert Comment

ID: 7105398
i didn't use OleDrag!
LVL 49

Expert Comment

ID: 7923703
Hi rrorison,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

rrorison, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
DanRollins -- EE database cleanup volunteer

Accepted Solution

SpideyMod earned 0 total points
ID: 7968429
per recommendation

Community Support Moderator @Experts Exchange

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

688 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