473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

progress bar

Hi,
If i start a process using System.Diagnostics.Process.Start(myprog.exe,

myattributes)
is it possible to display a running process bar instead of showing a
DOS window which shows what the program is doing?
thanks

Mar 12 '06 #1
14 4192
mo********@yahoo.com.au wrote:
Hi,
If i start a process using System.Diagnostics.Process.Start(myprog.exe,

myattributes)
is it possible to display a running process bar instead of showing a
DOS window which shows what the program is doing?
thanks


You can use the ProcessInfo class to start the process with no window.
Don't know if that will do what you want.

Chris
Mar 12 '06 #2
Why don't you just run your progress bar in a seperate thread, instead
of a seperate process?
I think it would be safer that way (main program exits, so does
progress bar).
Also, you won't get a dos window (although use the Process Background
property to hide the dos prompt).

With a progress bar, you want to be able to call the STEP method to
make sure it actually increases as your program performs tasks.
This is a lot harder in another process (which is basically another
application) as opposed to another thread (same application).

Here's a simple example:

Dim frmProgress as new ProgressForm()
me.hide()
frmProgress.Show()

' do stuff
frmProgress.ProgressBar.Step()

' do more stuff
frmProgress.ProgressBar.Step()

' hack Microsoft site
frmProgress.ProgressBar.Step()

' take over the world
frmProgress.ProgressBar.Step()

frmProgress.Close()
me.Show()
Steven Nagy

Mar 13 '06 #3
Hi Steven,
thanks for your reply but i do not understand what you mean.
I am a vb.net newbie

Mar 13 '06 #4
Lynn,

You don't have control of the process that is running in the DosBox.
Therefore the steps of the progressbar can not be measured. A progressbar
needs a begin, an end and the steps to reach that. You have only the begin.

I hope this gives an idea

Cor

"Lynn" <mo********@yahoo.com.au> schreef in bericht
news:11*********************@p10g2000cwp.googlegro ups.com...
Hi Steven,
thanks for your reply but i do not understand what you mean.
I am a vb.net newbie

Mar 13 '06 #5
What part don't you understand?
What is your final objective here? Perhaps give more of a rundown of
what you are trying to achieve.

Steve

Mar 13 '06 #6
i need to run a batch file from my windows form. Instead of displaying
what i am running to the user, i want to hide the DOS window and
replace it with a progress bar to tell me that the batch file is still
running. Not sure if this is possible.

Mar 15 '06 #7
Lynn,

That is in my opinion not possible. What is mostly done (as well by
Microsoft) is showing an AVI until the waitforexit is done.

http://msdn.microsoft.com/library/de...exittopic2.asp
Those AVI's are in Visual Studio Net somewhere in the program files (it can
be that you first have to unpack the zip file with those)

I hope this helps,

Cor.

Mar 15 '06 #8
if i use WaitForExit my windows form hangs with a white foreground
until the DOS command has finished executing.
is this normal? can this be overcome?

Mar 15 '06 #9
Cor,
can you also post a sample code on how showing an AVI is used with
waitforexit?
thanks

Mar 15 '06 #10
Lynn,

I have not the time to make a sample now however in pseudo code (almost
real).

Open a new project
Drag on that an picturebox
Set the image to a *gif* file.
You can find those in gif animations in
C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary

set the picturebox to visible = false

picturebox1.visible = true

Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.CreateNoWindow = True
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.exe"
Dim pr As System.Diagnostics.Process = System.Diagnostics.Process.Start(p)
pr.WaitForExit()

picturebox1.visible = false

I hope this helps,

Cor
Mar 15 '06 #11
Run the 'wait for exit' in a seperate thread. Have it raise an event
when done.
Have you main form catch the event and hide the pic box.

SN

Mar 17 '06 #12
Steven,
Run the 'wait for exit' in a seperate thread. Have it raise an event


Why a seperate thread to run a Gif? The Dos process itself is already in a
seperated process.

Cor
Mar 17 '06 #13
Its not the dos process that is the issue.
Its the main UI thread being told to wait for exit.
Which means I won't spend any time on redrawing your screen while its
waiting, thus the whiteness you mentioned.

Mar 18 '06 #14
can you post a sample code on this -> 'wait for exit' in a seperate
thread. Have it raise an event when done.
thanks in advance

Mar 18 '06 #15

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

Similar topics

3
by: SpamProof | last post by:
I got an animated gif that is a barber pole spinning that I want to use as a progress bar. The problem is that is stops spinning (shows 1 frame) when my browser is processing a submited request...
7
by: Pepi Tonas | last post by:
I have a form that takes some time to load because it has to populate some Data. I was trying to display a form on top of it with an activity bar so that user can see that something's going on. ...
1
by: scorpion53061 | last post by:
this code came from cor and I think Armin authored it. I am trying to download an access database and track its progress. It is reading the size fo the file but I am unsure of how to get the...
8
by: Brian Henry | last post by:
I created a smooth progress bar with this code.. but if you update the values in a row quickly of it and watch it on screen it flickers... how would i change this to reduce the flickering?...
8
by: WhiteWizard | last post by:
I guess it's my turn to ASK a question ;) Briefly my problem: I am developing a Windows app that has several User Controls. On one of these controls, I am copying/processing some rather large...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
15
by: eladla | last post by:
Hi! I am creating a composite control the does some of it`s own data access. I want to display a progress bar between the time the page is loaded and the control place holder is displayed and...
5
by: Aggelos | last post by:
Hello I am doing sevreral scripts like sending a newsletter that might take a while to finish first to prevent the browser from timing out and to keep the user informed of the process progress I...
1
by: Bob | last post by:
Hi, I am having trouble seeing how this bolts together. The UI starts a process which involves a long running database update. All Database activity is handled by a class called DT. DT has a...
0
by: jags_32 | last post by:
Hello We use MFG-PRO as our ERP system which in turn uses Progress databases. In the old version of SQL 2000, using DTS packages, we used to set the code page via command prompts and execute DTS...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.