Board index » delphi » Need help please!!!! Quick!!

Need help please!!!! Quick!!

Quote
[TGM] Junkie wrote:

> Hey!

> I'm in the middle of making an installation program in Delphi Pascal 2.0
> and I'm stuck with this problem:

> I just can't find a way to execute pkunzip and thereby extract some
> files.

> Could any of you please tell me the name of the command I should use,
> and how to use it??

> Thanks in advance

> Rune Petersen

The easiest way is to use ShellApi function: ShellExecute.
The more flexible way is to use WIN32 API CreateProcess, then
wait its termination with WaitForSingleObject, finally close its
process handle by CloseHandle.

Next time please DON't cross-post your articles to such many groups.
--
Best: Andrew

-----------------------------------------------------------------------------------------------
ATTN: Remove the .remove from the end of return address. It is to
prevent me from junk mailers.
-----------------------------------------------------------------------------------------------

 

Re:Need help please!!!! Quick!!


Quote
Bernyi Andrs wrote:
> The more flexible way is to use WIN32 API CreateProcess, then
> wait its termination with WaitForSingleObject, finally close its
> process handle by CloseHandle.

To start a 16-bit program from a 32-bit one and wait for its termination
under NT you can't simply use the process handle you got from
CreateProcess(..). Instead you have to start the new process in a
separate virtual machine using the Create_Separate_WOW_VDM constant in
CreateProcess(..). Then you must derive the process handle of the new
VDM from the process-ID you got from CreateProcess's ProcessInformation
record using the OpenProcess function. While this handle is valid (what
you best check with the GetExitCodeProcess function in a message loop,
to avoid blocking all other messages waiting for the current process
like WaitForSingleObject does) the newly created process is running.

Regards, Goeran

Other Threads