Julian,

> I can't find what is GetModuleUsage.. Any Idea.

GetModuleUsage returns the number of times the module was referenced.  For
EXEs, this is the number if instances of the EXE that is running.  For DLLs,
this is the number of LoadLibrary (both implicit and explicit) minus the
number of FreeLibrary calls that have been done on the module.  In 95 / 98,
the name of a module has to be unique system wide, but in NT, only the
path/filename needs to be unique.

You can also find a description in the Win32Api help file.

> I've found this somewhere in internet:
>
> Var
> Handle : Word;
> begin
> Handle := WinExec('Appname.exe',SW_ShowNormal);
> While GetModuleUsage(Handle) > 0 do
> Application.Processmessages;
> end;

The above code is obsolete in 32-bit windows.  Use CreateProcess and
WaitForSingleObject / WaitForMultipleObjects instead.


Regards,
Dennis.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to