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. Execute an external .EXE

Execute an external .EXE

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++delphi
6 Posts 5 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
    Martin_Viet
    wrote on last edited by
    #1

    hi again. i need exetute an external .exe, in delphi i allways do it with ShellExecute how can i do it in C++? :~ el hombre es libre cada vez que elige y eso es lo que lo hace libre

    B L M 3 Replies Last reply
    0
    • M Martin_Viet

      hi again. i need exetute an external .exe, in delphi i allways do it with ShellExecute how can i do it in C++? :~ el hombre es libre cada vez que elige y eso es lo que lo hace libre

      B Offline
      B Offline
      Big Art
      wrote on last edited by
      #2

      Use ShellExecute(..) in C++ as well. Art

      N 1 Reply Last reply
      0
      • M Martin_Viet

        hi again. i need exetute an external .exe, in delphi i allways do it with ShellExecute how can i do it in C++? :~ el hombre es libre cada vez que elige y eso es lo que lo hace libre

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        See the VC forum FAQ - 6.4 How do I run another program from my program?[^] --Mike--    THERE IS NO     THERE IS NO    BUT THERE IS MAGIC PIXIE DUST  BUSINESS GENIE  CODE PROJECT Homepage | RightClick-Encrypt | 1ClickPicGrabber "You have Erica on the brain" - Jon Sagara to me

        1 Reply Last reply
        0
        • M Martin_Viet

          hi again. i need exetute an external .exe, in delphi i allways do it with ShellExecute how can i do it in C++? :~ el hombre es libre cada vez que elige y eso es lo que lo hace libre

          L Offline
          L Offline
          LiquidKnight
          wrote on last edited by
          #4

          Amazingly enough its the same in C++ you use shell execute. I am not familar with the pascal langauge but I am guessing the shell execute is a bit more extended then pascal. Yet don't quote me on that anyways this is how you do it. Code: HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ); or for exe file execution ShellExecute(NULL,"open","myfile.exe",SW_SHOW); any other questions feel free to ask at my aim name vethax0r - LiquidKnight

          M 1 Reply Last reply
          0
          • B Big Art

            Use ShellExecute(..) in C++ as well. Art

            N Offline
            N Offline
            NormDroid
            wrote on last edited by
            #5

            or CreateProcess, useful if you want to wait om the process terminating. To iterate is human, to recurse is devine.

            1 Reply Last reply
            0
            • L LiquidKnight

              Amazingly enough its the same in C++ you use shell execute. I am not familar with the pascal langauge but I am guessing the shell execute is a bit more extended then pascal. Yet don't quote me on that anyways this is how you do it. Code: HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ); or for exe file execution ShellExecute(NULL,"open","myfile.exe",SW_SHOW); any other questions feel free to ask at my aim name vethax0r - LiquidKnight

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

              Thanks at all. ;) el hombre es libre cada vez que elige y eso es lo que lo hace libre

              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