Re: Opening multiple files with my applicaton



On Dec 26, 6:10 pm, Family Tree Mike
<FamilyTreeM...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"kimiraikkonen" wrote:
Hi,
I have an app which has a listbox and when i double click an
associated fileS, i want their paths to be added into listbox in my
application.

This code works good when i try to open a "single" file with my app
which works to get commandline arguments to get file paths:

Dim cla As String() = Environment.GetCommandLineArgs()
If cla.Length > 1 Then
ListBox1.Items.Add(cla(1))
End if

But this doesn't work while opening more than one files at the same
time.

You are only adding the first item from the command line. Change your code
to:

Dim cla As String() = Environment.GetCommandLineArgs()
Dim idx as Integer

If cla.Length > 1 Then
for idx = 1 to (cla.Length-1)
ListBox1.Items.Add(cla(idx))
next idx
endif

Hi Family Tree Mike,
Tried your code but only one file's path is added into listbox when i
try to open more than one file "with" my app by selecting CTRL + mouse
left click.

The thing i want to implement is exactly like when you select more
than one files, then "open with" Windows Media Player, then these
files are added into playlist of WMP. The same strategy i want to see
worked.(I only want to add paths of fileS).

Thanks.
.



Relevant Pages

  • Re: Advice Needed...
    ... items in a listbox). ... What about access controls is better? ... looking) is that they can handle multi-column data, where a VB6 listbox ... The only real issue is the problems when an app shuts down unexpectedly. ...
    (microsoft.public.vb.general.discussion)
  • Re: Opening multiple files with my applicaton
    ... Dim cla As String() = Environment.GetCommandLineArgs ... i want their paths to be added into listbox in my ... This code works good when i try to open a "single" file with my app ...
    (microsoft.public.dotnet.languages.vb)
  • Getting killed by idle tasks or something else?
    ... I have a Tk app that has a large listbox. ... grab works, but takes ~.5 seconds before it is actually "grabs" and I ... I am running idletasks pretty regularly, but assumed that it was not ...
    (comp.lang.perl.tk)
  • Re: Seeking: some advice about program structure (MFC dialog app)
    ... dialog app is actually the best possible app. ... you add its name to the two listbox controls. ... Add OnLButtonDown, OnLButtonUp, OnMouseMove handlers, and an OnPaint handler. ... When you click the mouse down and drag, the image in the window being dragged is moved, ...
    (microsoft.public.vc.mfc)
  • RE: Opening multiple files with my applicaton
    ... i want their paths to be added into listbox in my ... This code works good when i try to open a "single" file with my app ... Dim cla As String= Environment.GetCommandLineArgs ... Dim idx as Integer ...
    (microsoft.public.dotnet.languages.vb)

Loading