Board index » delphi » Help: Exec command with TPW 1.5

Help: Exec command with TPW 1.5

Hi all,

another try - I think I have problems with my newsserver thats why I
post this question again.

I'm not very experiencend in using Pascal. Till now I was happy with
my good old TP 7.0 but I try to use TPW 1.5 more and more.

Now I have a problem with converting a program from DOS to Windows. I
use the 'exec' command for executing some DOS batch files and exe
files. This command isn't available within TPW. What can I do to get
the following command working in TPW:

  exec('example.exe',parameters);

I hope someone can help me. Thanks in advance.

Andy

 

Re:Help: Exec command with TPW 1.5


Quote
On Sat, 09 Jan 1999 22:42:14 GMT, nos...@online.de (Andy) wrote:
>files. This command isn't available within TPW. What can I do to get
>the following command working in TPW:

>  exec('example.exe',parameters);

Okay, I got the answer already. The command is Winexec.

Bye
Armin

Re:Help: Exec command with TPW 1.5


Quote
Andy (nos...@online.de) wrote:

:
: I have a problem with converting a program from DOS to Windows. I
: use the 'exec' command for executing some DOS batch files and exe
: files. This command isn't available within TPW. What can I do to get
: the following command working in TPW:
:
:   exec('example.exe',parameters);
:
There is a similar command in windows:

NewProgram := WinExec( FileName+' '+Parameters, SW_ShowNormal);
              {Requires both WinProcs and WinTypes units.}

Unlike DOS, your main program will continue running along with the new
program.  It will NOT stop and wait for the other program to finish.
If this is a problem (it was for me), then you could loop while waiting
for the other program to finish:

While 0<GetModuleFileName(NewProgram,@Buffer,SizeOf(Buffer))
      and Buffer=FileName do
  While GetMessage(Message,0,0,0) do begin
    TranslateMessage(Message);
    DispatchMessage(Message);
  end;

Can anyone tell me a better way?

  |\/|                          ||  Burnaby South Secondary School
  |  |orew...@planeteer.com     ||    Beautiful British Columbia
Mathematics & Computer Science  ||             (Canada)

Other Threads