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 / C++ / MFC
  4. Open File with default program

Open File with default program

Scheduled Pinned Locked Moved C / C++ / MFC
adobetutorialquestion
6 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.
  • M Offline
    M Offline
    marcogja
    wrote on last edited by
    #1

    I've been search around web, and I can't find how can I code a dialog to open a file with his respective application. For example, Click on button an open a pdf on adobe reader.

    S H 2 Replies Last reply
    0
    • M marcogja

      I've been search around web, and I can't find how can I code a dialog to open a file with his respective application. For example, Click on button an open a pdf on adobe reader.

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      ShellExecute. Steve

      1 Reply Last reply
      0
      • M marcogja

        I've been search around web, and I can't find how can I code a dialog to open a file with his respective application. For example, Click on button an open a pdf on adobe reader.

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        like this CString FileName=_T("Ping"); CString strParam=_T("127.0.0.1"); ShellExecute(NULL,_T("open"), FileName,strParam,NULL,SW_SHOW);

        M 1 Reply Last reply
        0
        • H Hamid Taebi

          like this CString FileName=_T("Ping"); CString strParam=_T("127.0.0.1"); ShellExecute(NULL,_T("open"), FileName,strParam,NULL,SW_SHOW);

          M Offline
          M Offline
          marcogja
          wrote on last edited by
          #4

          And If I want to open a pdf on folder? I want to attach to my program a Help manual on pdf.

          R 1 Reply Last reply
          0
          • M marcogja

            And If I want to open a pdf on folder? I want to attach to my program a Help manual on pdf.

            R Offline
            R Offline
            RicoH
            wrote on last edited by
            #5

            Just use ShellExecute like this: ShellExecute(NULL, _T("open"), "C:\\MyFolder\\MyPdf.pdf", "", "", SW_SHOW); RicoH Don't think you are, know you are... custom hardware & software - olloc.be -- modified at 10:48 Friday 12th May, 2006

            M 1 Reply Last reply
            0
            • R RicoH

              Just use ShellExecute like this: ShellExecute(NULL, _T("open"), "C:\\MyFolder\\MyPdf.pdf", "", "", SW_SHOW); RicoH Don't think you are, know you are... custom hardware & software - olloc.be -- modified at 10:48 Friday 12th May, 2006

              M Offline
              M Offline
              marcogja
              wrote on last edited by
              #6

              thx a lot for all helps.

              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