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. Getting default PDF viewer

Getting default PDF viewer

Scheduled Pinned Locked Moved C#
tutorialquestion
3 Posts 3 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.
  • B Offline
    B Offline
    bankai123
    wrote on last edited by
    #1

    Hi, I want to run a process to view a PDF file. However I'm unsure of how to retrieve the default application to view a certain file type. Can someone point me in the right direction?

    J W 2 Replies Last reply
    0
    • B bankai123

      Hi, I want to run a process to view a PDF file. However I'm unsure of how to retrieve the default application to view a certain file type. Can someone point me in the right direction?

      J Offline
      J Offline
      JacquesDP
      wrote on last edited by
      #2

      If I understand correctly you just need to open the file, windows will open it with the default application associated with that file type. You can use System.Diagnostics.Process.Start(Path);

      He who laughs last is a bit on the slow side

      1 Reply Last reply
      0
      • B bankai123

        Hi, I want to run a process to view a PDF file. However I'm unsure of how to retrieve the default application to view a certain file type. Can someone point me in the right direction?

        W Offline
        W Offline
        Weckmann
        wrote on last edited by
        #3

        You can use the Shell32 dll to get the executables for certain extensions... [DllImport("shell32.dll", EntryPoint="FindExecutable")] private static extern long FindExecutableA(string file, string directory, StringBuilder res); There is a nice tutorial somewhere in Codeproject if I remember right...

        -------------------- Bertram Weckmann www.svizzer.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