[C#] Open With - Target file... >_<

DrEvil

FCRI Associate!
Reaction score
111
I have created an 'editor' in C# and it has functions as 'new map' 'save map' 'load map'
They all work... but you know when you right click any file and press 'open with' and it opens that program and the file you selected.

I was wondering how I would go about doing this in C#
to further explain:

file: map1.mfi
right click-> open with-> game editor

the game editor loads and knows that I have opened 'map1.mfi' and instantly loads that file...

Did a bit of research but couldn't find any solutions...

all help would be appreciated <3
 

DrEvil

FCRI Associate!
Reaction score
111
that's kinda what I meant if I go to the properties then change the default program to my editor

like i change the default program to the editor..
double click the file, but only the editor loads not the actually map...

is there some kind of form event when opened by a file or .... hmmm


form1.openedByFile... I dunno just guessing xD


not a big deal... but I mean I just would like it to open the file aswell xD

'but I know how to make it so on double click, it opens correctly.'
could you explain that then please :)
 

Vestras

Retired
Reaction score
248
I'm pretty sure there's an Application.CommandLine or something that you should process on startup, whether it contains a file path etc.
 

DrEvil

FCRI Associate!
Reaction score
111
yeah thanks Vestras

Environment.CommandLine

but I gotta chop of the first string as that is what is getting launched, then the next where the opened file was ;) :
"C://...//editor.exe" "C://...//mapfile"


Oh how I love a helpful community <3
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
I wanted to show you how to put your program as default program for a file, program way, on installation.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top