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. .NET (Core and Framework)
  4. How create process with visible window on desk from a system process ?

How create process with visible window on desk from a system process ?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpwindows-adminhelpquestion
4 Posts 2 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.
  • S Offline
    S Offline
    Stephan Pilz
    wrote on last edited by
    #1

    Hello together, I start a new process inside a system process (IIS web service) like this:Dim pProcess As New System.Diagnostics.Process Dim sArguments As String = "" pProcess.StartInfo.FileName = "process.exe" pProcess.StartInfo.Arguments = sArguments pProcess.StartInfo.WorkingDirectory = "c:\temp" pProcess.StartInfo.CreateNoWindow = False pProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal pProcess.Start()
    Process is startet, but the window is not visible on the desk. I think, the problem is the system process as father. If the new process throws an exception, the window is visible. Did anybody know, how I can make the process window visible on the desk? Can be some nice parameters on the process object himself or inside the process (source code is written in VB.NET). Thanks Stephan

                   \\\\\\|///
                 \\\\  - -  //
                  (  @ @  )
    

    +---------------oOOo-(_)-oOOo-----------------+
    | Stephan Pilz stephan.pilz@stephan-pilz.de |
    | www.stephan-pilz.de |
    | ICQ#: 127823481 |
    +-----------------------Oooo------------------+
    oooO ( )
    ( ) ) /
    \ ( (_/
    \_)

    D 1 Reply Last reply
    0
    • S Stephan Pilz

      Hello together, I start a new process inside a system process (IIS web service) like this:Dim pProcess As New System.Diagnostics.Process Dim sArguments As String = "" pProcess.StartInfo.FileName = "process.exe" pProcess.StartInfo.Arguments = sArguments pProcess.StartInfo.WorkingDirectory = "c:\temp" pProcess.StartInfo.CreateNoWindow = False pProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal pProcess.Start()
      Process is startet, but the window is not visible on the desk. I think, the problem is the system process as father. If the new process throws an exception, the window is visible. Did anybody know, how I can make the process window visible on the desk? Can be some nice parameters on the process object himself or inside the process (source code is written in VB.NET). Thanks Stephan

                     \\\\\\|///
                   \\\\  - -  //
                    (  @ @  )
      

      +---------------oOOo-(_)-oOOo-----------------+
      | Stephan Pilz stephan.pilz@stephan-pilz.de |
      | www.stephan-pilz.de |
      | ICQ#: 127823481 |
      +-----------------------Oooo------------------+
      oooO ( )
      ( ) ) /
      \ ( (_/
      \_)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      So why would a Web Service be starting an interactive process on the server? Since services run under they're own desktop, the window is getting created, just on a desktop that is hidden from view.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      S 1 Reply Last reply
      0
      • D Dave Kreskowiak

        So why would a Web Service be starting an interactive process on the server? Since services run under they're own desktop, the window is getting created, just on a desktop that is hidden from view.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        S Offline
        S Offline
        Stephan Pilz
        wrote on last edited by
        #3

        Because the web service is only a wrapper to business logic process and I want to see some trace messages from the BL-process. Store this messages in event log or a log file is not a solution for me. Please don't ask why I do it so, because there is no other way. Please give me hints, tricks or ideas to solve my problem. It's not possible to change the infrastructure. Stephan

                       \\\\\\|///
                     \\\\  - -  //
                      (  @ @  )
        

        +---------------oOOo-(_)-oOOo-----------------+
        | Stephan Pilz stephan.pilz@stephan-pilz.de |
        | www.stephan-pilz.de |
        | ICQ#: 127823481 |
        +-----------------------Oooo------------------+
        oooO ( )
        ( ) ) /
        \ ( (_/
        \_)

        D 1 Reply Last reply
        0
        • S Stephan Pilz

          Because the web service is only a wrapper to business logic process and I want to see some trace messages from the BL-process. Store this messages in event log or a log file is not a solution for me. Please don't ask why I do it so, because there is no other way. Please give me hints, tricks or ideas to solve my problem. It's not possible to change the infrastructure. Stephan

                         \\\\\\|///
                       \\\\  - -  //
                        (  @ @  )
          

          +---------------oOOo-(_)-oOOo-----------------+
          | Stephan Pilz stephan.pilz@stephan-pilz.de |
          | www.stephan-pilz.de |
          | ICQ#: 127823481 |
          +-----------------------Oooo------------------+
          oooO ( )
          ( ) ) /
          \ ( (_/
          \_)

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Stephan Pilz wrote:

          Please don't ask why I do it so, because there is no other way

          Keep that up and you'll be completely on your own in no time. Since your ASP.NET WEb Service cannot show a user interface on the server hosting it, you'll have to supply a UI some other way, like a normal Windows Forms app running a custom TraceListener exposed as a singleton class inside a WCF Service. Well, a rather convoluted solution would be to create your own implementation of a TraceListener, setup as a singleton, in a host application that shows all incomming trace messages. This trace listener would be exposed through the host as a remotable object, or do the same thing as a WCF service hosted in a Windows Form or Console application. In your Web Service Global.asax page, in possibly the Application_Start, Session_Start, or Application_BeginRequest handlers, you'd get the reference to the custom trace listener, add it to the Trace.Listeners collection in your Web Service, handle the call and output your trace messages. The custom TraceListenerwould output any messages to a TextBox, Console window, log to a file, ..., whatever you want. The downside is that this is a convoluted solution. The up side is that is lets you deploy your web service to multiple servers and still log all trace messages to a single window on a single monitoring workstation.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          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