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. How to perform opening a file?

How to perform opening a file?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
4 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.
  • E Offline
    E Offline
    ewighell
    wrote on last edited by
    #1

    Given the path of the file, how to open it with code? just like you double click it. Thank you very much!!!

    S H 2 Replies Last reply
    0
    • E ewighell

      Given the path of the file, how to open it with code? just like you double click it. Thank you very much!!!

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

      Use ShellExecute with the "open" verb. e.g. ShellExecute(      NULL, // HWND hwnd      _T("open"), // LPCTSTR lpOperation      _T("C:\\a.txt"), // LPCTSTR lpFile      NULL, // LPCTSTR lpParameters      NULL, // LPCTSTR lpDirectory      SW_SHOWDEFAULT // INT nShowCmd      ); You will need to #include <shellapi.h> and link to "shell32.lib". Steve

      E 1 Reply Last reply
      0
      • S Stephen Hewitt

        Use ShellExecute with the "open" verb. e.g. ShellExecute(      NULL, // HWND hwnd      _T("open"), // LPCTSTR lpOperation      _T("C:\\a.txt"), // LPCTSTR lpFile      NULL, // LPCTSTR lpParameters      NULL, // LPCTSTR lpDirectory      SW_SHOWDEFAULT // INT nShowCmd      ); You will need to #include <shellapi.h> and link to "shell32.lib". Steve

        E Offline
        E Offline
        ewighell
        wrote on last edited by
        #3

        thank you very much for your help.

        1 Reply Last reply
        0
        • E ewighell

          Given the path of the file, how to open it with code? just like you double click it. Thank you very much!!!

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

          See http://www.codeproject.com/system/newbiespawn.asp[^]_**


          **_

          whitesky


          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