Solved

Shell Question VB.Net

Posted on 2006-06-22
3
240 Views
Last Modified: 2010-04-23
I need to run an application by stating its associated file....

emulating when you click on a known file type in a drive window and having windows start the editor for that file type and loading the file to edit that I clicked on....

Can you tell me how you do that???

0
Comment
Question by:ExtremeFitness
[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
3 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 16960396
Simply...

    Process.Start("c:\someFile.ext")
0
 
LVL 2

Author Comment

by:ExtremeFitness
ID: 16960549
Do you know how I have the calling program wait until the called program exits?
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16960602
The simplest method would be:

        Dim p As Process = Process.Start("c:\someFile.ext")
        p.WaitForExit()

*** BUT *** this locks up the calling process until the spawned process exits.

You can use a Polling loop like this though:

        Dim p As Process = Process.Start("c:\someFile.ext")
        While Not p.HasExited
            System.Threading.Thread.Sleep(100)
            Application.DoEvents()
        End While

If a polling loop is unacceptable then encapsulate the Process() in a Class and place it on a different thread.  Then you use WaitForExit() without locking up your GUI.  Make the Class raise a custom event when the Process is complete.  Since you are using Threads, you would need to Marshal the event back onto the main UI using a Delegate and Invoke().  Let me know if you want to see an example of this...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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