Solved

how to pass some file loaded by association?

Posted on 2002-04-09
6
187 Views
Last Modified: 2012-05-04
Im making a program like winamp for my car that play mp3 files. And the question is: How can i pass the name of the file that I select in the Windows Explorer??

I can make the association in windows but always start a new copy of my program, the I use COMMAND to obtain the arguments (in this case the file name). But how can i program something like "Enqueue in Winamp" to my application??. The idea is that when I doble-clic in a file that name pass to my program to enqueue in my program??

thankx,
and sorry about my bad english
0
Comment
Question by:zucos
6 Comments
 

Author Comment

by:zucos
ID: 6929508
not starting another copy of my program.. just using the program currently opened.
0
 
LVL 1

Expert Comment

by:COAtheGREAT
ID: 6929608
set project type to ActiveX EXE
and start mode as Standalone

for the bigining :)
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 6929618
In project/options change startup from "form1" to "Sub Main"

Sub Main()
    Dim OldTitle$

    If App.PrevInstance Then
        OldTitle = App.Title
        AppActivate OldTitle
        End
    End If

    Form1.Show
End Sub

0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 32

Accepted Solution

by:
bhess1 earned 200 total points
ID: 6929633
Have your application look for a previous instance of your app already running.  If it finds one, pass the information to that app and terminate.

There is a sample app that does just that here:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=22061&lngWId=1

and here

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=28394&lngWId=1
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6929679

U can make a server-client application ie

1- U can compile Ur program as an activex exe (not standard exe) making a public proc in its class module (not a form ) this public proc  will get Ur string and pass it to the form this will be server app

2- then maka another small prog refering to the first one
(in project - references refer to Ur compiled exe)

3- inside client module call server module procedure
0
 

Author Comment

by:zucos
ID: 6929689
thankx to everyone.
the answer of bhess1 solve my problem.

thankx for answering that fast
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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