473,473 Members | 1,491 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Process.start problem

I would like to call a .NET executable file in a windows serviceat certain intervals of time. The following is the codesnippet, I put in. I am not receiving any error in my errorhandling routine (as it writes as a log entry). But my problemis, the respective application doesn't popup on screen and getvisible. I desperately need the application to be visible whenit does some work (just to know basically the status andprogress of the process it is doing). I copied calc.exe intothe root to test it. But I didn't test with anything else. Cananybody help me please.

'first method
'Dim proc As Process = Process.Start("c:\calc.exe")

'second method
'Dim startInfo As New ProcessStartInfo("c:\calc.exe")
'startInfo.CreateNoWindow = False
'startInfo.WindowStyle = ProcessWindowStyle.Normal
'Process.Start(startInfo)

'third method
'Shell("c:\calc.exe"), AppWinStyle.NormalFocus, False)
--------------------------------
From: Jag Chat

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>B4LbdimKaEiimGaxfH4nzA==</Id>
Nov 20 '05 #1
2 2808
I think what you are looking for is:
..AppActivate

Dim ProcID As Integer
' Start the Calculator application, and store the process
id.
ProcID = Shell("CALC.EXE", AppWinStyle.NormalFocus)
' Activate the Calculator application.
AppActivate(ProcID)'Activates an application window.
SendKeys.SendWait("22")
SendKeys.SendWait("*")
SendKeys.SendWait("44")
SendKeys.SendWait("=")

-----Original Message-----
I would like to call a .NET executable file in a windows service at certain intervals of time. The following is
the code snippet, I put in. I am not receiving any error
in my error handling routine (as it writes as a log
entry). But my problem is, the respective application
doesn't popup on screen and get visible. I desperately
need the application to be visible when it does some work
(just to know basically the status and progress of the
process it is doing). I copied calc.exe into the root to
test it. But I didn't test with anything else. Can
anybody help me please.
'first method
'Dim proc As Process = Process.Start("c:\calc.exe")

'second method
'Dim startInfo As New ProcessStartInfo("c:\calc.exe")
'startInfo.CreateNoWindow = False
'startInfo.WindowStyle = ProcessWindowStyle.Normal
'Process.Start(startInfo)

'third method
'Shell("c:\calc.exe"), AppWinStyle.NormalFocus, False)
--------------------------------
From: Jag Chat

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>B4LbdimKaEiimGaxfH4nzA==</Id>
.

Nov 20 '05 #2
I just might hold back on that last solution.
I remember hearing someting about services not alowed
to display things.
-----Original Message-----
I think what you are looking for is:
..AppActivate

Dim ProcID As Integer
' Start the Calculator application, and store the process
id.
ProcID = Shell("CALC.EXE", AppWinStyle.NormalFocus)
' Activate the Calculator application.
AppActivate(ProcID)'Activates an application window.
SendKeys.SendWait("22")
SendKeys.SendWait("*")
SendKeys.SendWait("44")
SendKeys.SendWait("=")

-----Original Message-----
I would like to call a .NET executable file in a windows

service at certain intervals of time. The following is
the code snippet, I put in. I am not receiving any error
in my error handling routine (as it writes as a log
entry). But my problem is, the respective application
doesn't popup on screen and get visible. I desperately
need the application to be visible when it does some work
(just to know basically the status and progress of the
process it is doing). I copied calc.exe into the root to
test it. But I didn't test with anything else. Can
anybody help me please.

'first method
'Dim proc As Process = Process.Start("c:\calc.exe")

'second method
'Dim startInfo As New ProcessStartInfo("c:\calc.exe")
'startInfo.CreateNoWindow = False
'startInfo.WindowStyle = ProcessWindowStyle.Normal
'Process.Start(startInfo)

'third method
'Shell("c:\calc.exe"), AppWinStyle.NormalFocus, False)
--------------------------------
From: Jag Chat

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>B4LbdimKaEiimGaxfH4nzA==</Id>
.

.

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
10
by: Sorin Dolha [MCSD .NET] | last post by:
I would like to start a process from C# code as another user. The C# code is executed as the ASPNET user because it relies in a Web Page class, and I would like that the process will run as another...
7
by: Samantha | last post by:
Hello , I am developping a program for Win98 plateform, and I am stucking with a problem, hope you can help me. I have a program running 2 process : - One process running the Xcopy.exe -...
6
by: gizmo | last post by:
I have a requirement to initiate more than one instance of an application using the filenames. (the example below will start two instances of MS Word). My problem is that I need to kill each...
12
by: Raymond Lewallen | last post by:
How to wait for a process to stop completion is my goal. Obviously, the looping while waiting for the HasExited property is not a solution.. but thats the best I can come up off the top of my...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
1
by: Frank | last post by:
Hi, I use the standard example to start a program: Private Sub StartWithArguments() ' Declare and instantiate a new process component. Dim myproc As System.Diagnostics.Process myproc = New...
0
by: Sergistm | last post by:
Hello World, :D I have a problem that it is making me crazy, I hope you can help me. I'm trying to execute a .exe file with the Procces.Start, and there is no problem when the file is on my...
4
by: Paul | last post by:
Hi, I am trying to start a process hidden. My code: wordprocess = new System.Diagnostics.Process(); ; wordprocess.StartInfo = new System.Diagnostics.ProcessStartInfo(wcmd, args);...
7
by: =?Utf-8?B?ams=?= | last post by:
I am using System.Diagnostics.Process class to open a word document by call ing Process.Start("test.doc"). I am using C# as programming language. On some of the computers on running this code i get...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.