How create process with visible window on desk from a system process ?
-
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 ( )
( ) ) /
\ ( (_/
\_) -
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 ( )
( ) ) /
\ ( (_/
\_)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 -
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, 2007Because 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 ( )
( ) ) /
\ ( (_/
\_) -
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 ( )
( ) ) /
\ ( (_/
\_)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