Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Open With (my App)

Open With (my App)

Scheduled Pinned Locked Moved C#
questioncsharpwpfxmltutorial
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I have an application that is essentially a fancy XML editor. It knows the specifics of the XML it is opening and knows how the end users want info displayed (and hides other stuff). How can I make it so these files are tied to the app. Right now the files end with .xml (as they are xml files) but that can of course be changed by the outputting application. So lets say we change the extension to .blah How then do I build my app so it can be started by opening the file. There seem to be 2 details needed here. 1.) How to automate the association End users can of course click the file and say "Open With". I would like to avoid that. So How during installation of my app to I tie the file type to the application. 2.) How does that application change? Right now it is a WPF application that opens the files by either Hot Keys (Ctrl-O) or File->Open. Does the start app need to be a console app so it can get arguments, then the console app starts the WPF? I am quite confused here. Thanks in advance.

    Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

    S Y L 3 Replies Last reply
    0
    • L Lost User

      I have an application that is essentially a fancy XML editor. It knows the specifics of the XML it is opening and knows how the end users want info displayed (and hides other stuff). How can I make it so these files are tied to the app. Right now the files end with .xml (as they are xml files) but that can of course be changed by the outputting application. So lets say we change the extension to .blah How then do I build my app so it can be started by opening the file. There seem to be 2 details needed here. 1.) How to automate the association End users can of course click the file and say "Open With". I would like to avoid that. So How during installation of my app to I tie the file type to the application. 2.) How does that application change? Right now it is a WPF application that opens the files by either Hot Keys (Ctrl-O) or File->Open. Does the start app need to be a console app so it can get arguments, then the console app starts the WPF? I am quite confused here. Thanks in advance.

      Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

      S Offline
      S Offline
      Samuel Cherinet
      wrote on last edited by
      #2

      when creating your deployment project,... use the "File Type" Editor to do the association of a file extension to your app, you can configure down to an icon for your files. am not that familiar with WPF, but I can tell you that it does not have to be a console app to pass the args (which will be the file name when you double click on your file type icon). anything that has main entry funtion can be used(i.e windows forms application)

      1 Reply Last reply
      0
      • L Lost User

        I have an application that is essentially a fancy XML editor. It knows the specifics of the XML it is opening and knows how the end users want info displayed (and hides other stuff). How can I make it so these files are tied to the app. Right now the files end with .xml (as they are xml files) but that can of course be changed by the outputting application. So lets say we change the extension to .blah How then do I build my app so it can be started by opening the file. There seem to be 2 details needed here. 1.) How to automate the association End users can of course click the file and say "Open With". I would like to avoid that. So How during installation of my app to I tie the file type to the application. 2.) How does that application change? Right now it is a WPF application that opens the files by either Hot Keys (Ctrl-O) or File->Open. Does the start app need to be a console app so it can get arguments, then the console app starts the WPF? I am quite confused here. Thanks in advance.

        Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

        Y Offline
        Y Offline
        Yusuf
        wrote on last edited by
        #3

        Look at this CP Article - System File Association[^]. It may shed some light as to what you want to accomplish

        Yusuf May I help you?

        1 Reply Last reply
        0
        • L Lost User

          I have an application that is essentially a fancy XML editor. It knows the specifics of the XML it is opening and knows how the end users want info displayed (and hides other stuff). How can I make it so these files are tied to the app. Right now the files end with .xml (as they are xml files) but that can of course be changed by the outputting application. So lets say we change the extension to .blah How then do I build my app so it can be started by opening the file. There seem to be 2 details needed here. 1.) How to automate the association End users can of course click the file and say "Open With". I would like to avoid that. So How during installation of my app to I tie the file type to the application. 2.) How does that application change? Right now it is a WPF application that opens the files by either Hot Keys (Ctrl-O) or File->Open. Does the start app need to be a console app so it can get arguments, then the console app starts the WPF? I am quite confused here. Thanks in advance.

          Computers have been intelligent for a long time now. It just so happens that the program writers are about as effective as a room full of monkeys trying to crank out a copy of Hamlet.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Collin Jasnoch wrote:

          Does the start app need to be a console app so it can get arguments

          FYI: all kinds of apps (Console, WinForm, ...) can get arguments, you pass them interactively on the command line, or in the definition of your Explorer desktop shortcut, or in your Visual Studio debug command line, or in ProcessStartInfo, or...; and your app gets them through the static Main parameters, or Environment.GetCommandLineArgs, or ... :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups