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?
BadBigShotAsked:
Who is Participating?
 
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
 
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
BadBigShotAuthor Commented:
I have VB.NET 2003

ya, sorry, that's what I meant : I simply associated the extension with my app
0
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.