Shell Commands

M

martins

Hi,

My application uses SHELL command to run external programs, like this :

Shell("program.exe", AppWinStyle.MinimizedNoFocus, True)

or

Shell("program.exe", AppWinStyle.Hide, True)

It runs OK, but my application don't refresh, I can't see the logs of my
application's listbox, nothing, it like it freezes/hangs alghought that
isn't true because all batch jobs runs 1 by 1 until the end

Just want to refresh my application, I tried doEvents but without success

thank you
 
M

martins

newbie said:
You have set the boolean to wait.
does program.exe also quit?

Yes it quits, I need that boolean ON because I have several jobs to run in
batch mode and I need to wait until each job ends

The only problem is that I can't activate my program - it says "not
responding"

but this is not true

Is it impossible to refresh my application or give it some focus ?

application.doenvents doesn't work, Shell's option of
AppWinStyle.MinimizedNoFocus or Hide, doesn't work

This jobs needs very processor and memory recurses
 
K

karlgardner

Shell is the old way of launching programs. You will find that you have
much better control useing the System.Diagnostics namespace.

Dim SI As New System.Diagnostics.ProcessStartInfo
SI.FileName = "program.exe"
SI.WindowStyle = ProcessWindowStyle.Hidden
Dim p As System.Diagnostics.Process =
System.Diagnostics.Process.Start(SI)
p.WaitForExit()
Me.Refresh()
 
N

newbie

what if your program is to busy to laubching all the programs?
Try to add a slow process like ( slow process = doesn't quit directly )
shell("ping www.google.be", .... )
your CPU = 99% ?
 
M

martins

I tried that process launch solution instead of shell command



Like this :



Dim SI As New System.Diagnostics.ProcessStartInfo
SI.FileName = startupfolder & "DVDAuthor\dvdauthor -o test -x " &
WorkingPath & "dvdauthor.xml"
SI.WindowStyle = ProcessWindowStyle.Hidden
Dim p As System.Diagnostics.Process =
System.Diagnostics.Process.Start(SI)
p.WaitForExit()
Me.Refresh()



And I always get an error on filename



But if I use shell command :



Shell(startupfolder & "DVDAuthor\dvdauthor -o test -x " & WorkingPath &
"dvdauthor.xml", AppWinStyle.Hide, True)



note: startupfolder is Application.ExecutablePath under I have all external
programs





It works, but my program freezes doesn't show the logs of all batch
processes, although IT WORKS WELL



The title of my application says always (NOT RESPONDING)



I'm stuck with this
 
M

martins

My program is just an GUI for DVDAuthoring, I'm doing this for my personal
use

And you know that encoding video/audio takes a lot of memory and cpu usage

I'm using DVDAuthoring tools from sourceforge, they are free, and an decoder
software that is...hummm...you know...

but as I said, this is for my personal use and is a case study

this batch threads are making me nuts because my app runs well but without
responding
 
M

martins

uff :)

problem of hard batch jobs solved

I just must use/launch a system thread

simple, the program responds now and shows the logs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top