• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

How can I get a running application to open a document from Windows Explorer?

Hi,

I configured my app to open JPG files in Windows Explorer.

I'd like my app to have only a single instance in which every JPG files are loaded. I guess I have to make my app check whether there is an instance already running and if there is, communicate in some way the filenames to this already running instance so that it can load the files.

but how do I set this communication between the instances? What's the clever way to do it? Is there an event for this?
0
BadBigShot
Asked:
BadBigShot
  • 2
  • 2
  • 2
1 Solution
 
Bob LearnedCommented:
1) .NET version?

2) How are you opening files with Windows Explorer?  Process.Start?

Bob
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
If you have .Net 2.0 (Visual Basic 2005) then the Application Model handles this nicely:
http://msdn2.microsoft.com/en-us/library/w3xx6ewx.aspx

Bob...I think he has associated the .jpg extension with his application so that when you double click jpg files they open with his app.
0
 
BadBigShotAuthor Commented:
I have VB.NET 2003

ya, sorry, that's what I meant : I simply associated the extension with my app
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Bob LearnedCommented:
1) I participate in a lot of questions
2) Their problem space is not easy to recognize
3) If I go off half-cocked, I run the risk of spinning my wheels
4) Now, I try to understand the space better up front, to eliminate waste
5) Sometimes when I take that extra time, someone will understand it better, and come breezing in with an answer.
6)The first time it happened I was quite offended (I felt dissed)--now, I am totally cool, if the question is answered, and I learn something at the same time.

@~IM,
What part of the Application Model are you talking about?

Bob
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
(It doesn't apply to BadBigShot since he has VB.Net 2003)
The StartupNextInstance() event allows you to pass command line parameters of new instances back to the first instance of the application:
http://msdn2.microsoft.com/en-us/library/b9z4eyh8.aspx
0
 
BadBigShotAuthor Commented:
Sorry, I don't have time to glance at 2005 right now so I'm just gonna give out the points even though I couldn't make it work in 2003.

I'm in deep schei├če after formatting my hard drives. I just seem to have my partitions randomly deleted now and then and I can't figure out why... I'm looking forward to test your solutions as soon as I get my tech prob solved!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now