M
Mark Rae
Hi,
I have written an MDI Windows forms app in C# which, among other things,
maintains data in XML files with a specific extension. I know how to
associate files of that extension with my app by using the Open With
functionality in Windows explorer - now if I click on one of the files, it
launches my app. However, how do I then get my app to open the file? In VB
classic, I used to use the Command$ method for this, but don't know what the
C# equivalent is.
Secondly, I have prevented multiple instances of my app from running with
the following code:
if
(System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.Ge
tCurrentProcess().ProcessName).GetUpperBound(0) > 0)
{
MessageBox.Show("Test Application is already running", "Test
Application", MessageBoxButtons.OK, MessageBoxIcon.Stop);
this.Close();
return;
}
However, I still want users to be able to click on a file to launch the app
and open the file, then click on another file which will also open the file
but not try to launch a second instance of the app, exactly the same as
clicking on, say, more than one Excel .xls file or more than one Word .doc
file would.
Is this possible?
Any assistance gratefully received.
Best regards,
Mark Rae
I have written an MDI Windows forms app in C# which, among other things,
maintains data in XML files with a specific extension. I know how to
associate files of that extension with my app by using the Open With
functionality in Windows explorer - now if I click on one of the files, it
launches my app. However, how do I then get my app to open the file? In VB
classic, I used to use the Command$ method for this, but don't know what the
C# equivalent is.
Secondly, I have prevented multiple instances of my app from running with
the following code:
if
(System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.Ge
tCurrentProcess().ProcessName).GetUpperBound(0) > 0)
{
MessageBox.Show("Test Application is already running", "Test
Application", MessageBoxButtons.OK, MessageBoxIcon.Stop);
this.Close();
return;
}
However, I still want users to be able to click on a file to launch the app
and open the file, then click on another file which will also open the file
but not try to launch a second instance of the app, exactly the same as
clicking on, say, more than one Excel .xls file or more than one Word .doc
file would.
Is this possible?
Any assistance gratefully received.
Best regards,
Mark Rae