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
  1. Home
  2. General Programming
  3. C#
  4. How to call default text editor

How to call default text editor

Scheduled Pinned Locked Moved C#
comtutorialquestion
5 Posts 4 Posters 0 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.
  • T Offline
    T Offline
    therealmccoy
    wrote on last edited by
    #1

    I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com

    C T M T 4 Replies Last reply
    0
    • T therealmccoy

      I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I'm not sure if Process.Start can do this, but ShellExecute ( via pInvoke ) definately can. Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • T therealmccoy

        I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com

        T Offline
        T Offline
        thealca
        wrote on last edited by
        #3

        I don't get it, anyway, .Net has already included the RichTextBox component to its library, why don't use it. I don't like using external programs (as much as possible)especially if I can create my own. Anyway that me :)

        1 Reply Last reply
        0
        • T therealmccoy

          I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com

          M Offline
          M Offline
          Mohamad Al Husseiny
          wrote on last edited by
          #4

          Process.Start(fileName);Will do it MCAD

          1 Reply Last reply
          0
          • T therealmccoy

            I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com

            T Offline
            T Offline
            therealmccoy
            wrote on last edited by
            #5

            Thanks all for you help. I used the Process.Start and passed in my textfile. I didn't use a RichTextBox because I didn't need/want to code the addtional functionality to print/preview etc. This application is also written as a DLL so that later it can be incorporated as a webservice. In addition where I work people have changed the application associated with *.txt to an editor that they prefer. Thanks again. I didn't realize that I could use Process.Start and just pass in a filename and let Windows handle the rest. www.lovethosetrains.com

            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