Question

I have OpenFileFialog realized in my Windows Forms application, but when I use Open With in file context menu, or add my item in context menu with command like "myapp.exe %1" it just opens application. Need I to do anything else to realize it?

Was it helpful?

Solution

This does nothing more than pass a filename as the first argument to your program. Just having an OpenFileDialog is completely irrelevant to that. You need to examine command-line arguments at startup and decide that you might want to open a file if one is given.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top