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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Executing an executable unmanaged exe file...

Executing an executable unmanaged exe file...

Scheduled Pinned Locked Moved C#
question
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.
  • E Offline
    E Offline
    erikash
    wrote on last edited by
    #1

    Hi guys, i need to execute such a file and supply it arguments, i've looked around and found the "System.Diagnostics.Process.Start()" method, it works great, but i want controll over the executed application... or at least run it in a minimized window state... any suggestions? (The executable is a program written in c) Thanks in advance, Erik.

    A J J 3 Replies Last reply
    0
    • E erikash

      Hi guys, i need to execute such a file and supply it arguments, i've looked around and found the "System.Diagnostics.Process.Start()" method, it works great, but i want controll over the executed application... or at least run it in a minimized window state... any suggestions? (The executable is a program written in c) Thanks in advance, Erik.

      A Offline
      A Offline
      Andrew Rissing
      wrote on last edited by
      #2

      You'll need to modify the ProcessStartInfo...see below for references: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessclassstartinfotopic.asp[^] The following lists the members that you'll need to modify: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessstartinfoclasstopic.asp[^] I believe that should work for you.

      1 Reply Last reply
      0
      • E erikash

        Hi guys, i need to execute such a file and supply it arguments, i've looked around and found the "System.Diagnostics.Process.Start()" method, it works great, but i want controll over the executed application... or at least run it in a minimized window state... any suggestions? (The executable is a program written in c) Thanks in advance, Erik.

        J Offline
        J Offline
        Judah Gabriel Himango
        wrote on last edited by
        #3

        Process proc = new Process();
        proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
        proc.StartInfo.FileName = "thefile.exe";
        proc.Start();

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: For Christians: The Significance of Yom Teruah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        E 1 Reply Last reply
        0
        • J Judah Gabriel Himango

          Process proc = new Process();
          proc.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
          proc.StartInfo.FileName = "thefile.exe";
          proc.Start();

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: For Christians: The Significance of Yom Teruah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

          E Offline
          E Offline
          erikash
          wrote on last edited by
          #4

          Thanks guys! Ok next question... the executable exe file gets input from the user (using scanf) is there a way to supply it arguments without changing the source code of the executable? (by changing the main to receive parameters and modifing the source code accordingly) I guess it has something to to with adding values to the input buffer of that application...? Thanks in advance, Erik.

          J 1 Reply Last reply
          0
          • E erikash

            Thanks guys! Ok next question... the executable exe file gets input from the user (using scanf) is there a way to supply it arguments without changing the source code of the executable? (by changing the main to receive parameters and modifing the source code accordingly) I guess it has something to to with adding values to the input buffer of that application...? Thanks in advance, Erik.

            J Offline
            J Offline
            Judah Gabriel Himango
            wrote on last edited by
            #5

            You can supply arguments to the executable by changing the ProcessStartInfo.Arguments property. Is that what you mean?

            Tech, life, family, faith: Give me a visit. I'm currently blogging about: For Christians: The Significance of Yom Teruah The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

            1 Reply Last reply
            0
            • E erikash

              Hi guys, i need to execute such a file and supply it arguments, i've looked around and found the "System.Diagnostics.Process.Start()" method, it works great, but i want controll over the executed application... or at least run it in a minimized window state... any suggestions? (The executable is a program written in c) Thanks in advance, Erik.

              J Offline
              J Offline
              Jim Conigliaro
              wrote on last edited by
              #6

              How about: myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

              Jim Conigliaro jconigliaro@ieee.org
              http://www.jimconigliaro.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