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. External program launch issue

External program launch issue

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
10 Posts 6 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
    Tnarol
    wrote on last edited by
    #1

    Hi, I tried several things to launch an external program : CString command("\"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that closes instantly and doesn't launch PSPad. CString command("cmd /C \"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that launches PSPad but the calling dialog looses focus until I close PSPad. Actually I'd like to launch my program just like double clicking on "log.txt" would do (without a command prompt would be great). Is it possible ? Thanks !

    L N T H 4 Replies Last reply
    0
    • T Tnarol

      Hi, I tried several things to launch an external program : CString command("\"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that closes instantly and doesn't launch PSPad. CString command("cmd /C \"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that launches PSPad but the calling dialog looses focus until I close PSPad. Actually I'd like to launch my program just like double clicking on "log.txt" would do (without a command prompt would be great). Is it possible ? Thanks !

      L Offline
      L Offline
      Laxman Auti
      wrote on last edited by
      #2

      Tnarol wrote:

      I'd like to launch my program just like double clicking on "log.txt" would do (without a command prompt would be great). Is it possible ?

      Use ShellExecute(...) or CreateProcess(...) API's for launching external application's Knock out 't' from can't, You can if you think you can :cool:

      1 Reply Last reply
      0
      • T Tnarol

        Hi, I tried several things to launch an external program : CString command("\"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that closes instantly and doesn't launch PSPad. CString command("cmd /C \"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that launches PSPad but the calling dialog looses focus until I close PSPad. Actually I'd like to launch my program just like double clicking on "log.txt" would do (without a command prompt would be great). Is it possible ? Thanks !

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        Tnarol wrote:

        Is it possible ?

        yes use ShellExecute nave

        1 Reply Last reply
        0
        • T Tnarol

          Hi, I tried several things to launch an external program : CString command("\"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that closes instantly and doesn't launch PSPad. CString command("cmd /C \"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that launches PSPad but the calling dialog looses focus until I close PSPad. Actually I'd like to launch my program just like double clicking on "log.txt" would do (without a command prompt would be great). Is it possible ? Thanks !

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          ::ShellExecute(NULL, "open", "D:\\USER\\PSPad editor\\PSPad.exe", "log.txt", NULL, SW_SHOW);


          TOXCCT >>> GEII power

          [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

          T _ 2 Replies Last reply
          0
          • T toxcct

            ::ShellExecute(NULL, "open", "D:\\USER\\PSPad editor\\PSPad.exe", "log.txt", NULL, SW_SHOW);


            TOXCCT >>> GEII power

            [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

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

            COOL ! It works great ! Thanks everyone.

            1 Reply Last reply
            0
            • T toxcct

              ::ShellExecute(NULL, "open", "D:\\USER\\PSPad editor\\PSPad.exe", "log.txt", NULL, SW_SHOW);


              TOXCCT >>> GEII power

              [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

              _ Offline
              _ Offline
              _AnsHUMAN_
              wrote on last edited by
              #6

              And you suggested this the other day!!! Your previous post[^] Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

              T L 2 Replies Last reply
              0
              • _ _AnsHUMAN_

                And you suggested this the other day!!! Your previous post[^] Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                broken link... use the little [getLink] button at the bottom of a thread when using posts liks...


                TOXCCT >>> GEII power

                [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

                _ 1 Reply Last reply
                0
                • T toxcct

                  broken link... use the little [getLink] button at the bottom of a thread when using posts liks...


                  TOXCCT >>> GEII power

                  [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

                  _ Offline
                  _ Offline
                  _AnsHUMAN_
                  wrote on last edited by
                  #8

                  http://www.codeproject.com/script/comments/forums.asp?msg=1529273&forumid=1647#xx1529273xx[^] Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

                  1 Reply Last reply
                  0
                  • _ _AnsHUMAN_

                    And you suggested this the other day!!! Your previous post[^] Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

                    L Offline
                    L Offline
                    Laxman Auti
                    wrote on last edited by
                    #9

                    _AnShUmAn_ wrote:

                    And you suggested this the other day!!!

                    COOL !!! :) Knock out 't' from can't, You can if you think you can :cool:

                    1 Reply Last reply
                    0
                    • T Tnarol

                      Hi, I tried several things to launch an external program : CString command("\"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that closes instantly and doesn't launch PSPad. CString command("cmd /C \"D:\\USER\\PSPad editor\\PSPad.exe\" \"log.txt\""); system(command); The above code launches a command prompt that launches PSPad but the calling dialog looses focus until I close PSPad. Actually I'd like to launch my program just like double clicking on "log.txt" would do (without a command prompt would be great). Is it possible ? Thanks !

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

                      See ShellExecute [^]_**


                      **_

                      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