WinExec and Wait Problem

As I am getting file access conflicts in my program using Winexec, I
downloaded the function WinExecAndWait from the Borland technical papers
site. On compiling the code I use it in, I found out that the
'GetModuleHandle' function was no longer supported in Win32.

Below the source code.

Does anybody know an W95 equivalent of this function?
Any help is appreciated

Marc

(---------------------------------------------------------------)
Function WinExecAndWait(Path : string; Visibility : word) : word;
var
  InstanceID : THandle;
  PathLen : integer;
begin
  { inplace conversion of a String to a PChar }
  PathLen := Length(Path);
  Move(Path[1],Path[0],PathLen);
  Path[PathLen] := #0;
  { Try to run the application }
  InstanceID := WinExec(@Path,Visibility);
  if InstanceID < 32 then { a value less than 32 indicates an Exec error }
     WinExecAndWait := InstanceID
  else
  begin
    Repeat
      Application.ProcessMessages;
        { Here it comes:}
    until Application.Terminated or (GetModuleUsage(InstanceID) = 0);
    WinExecAndWait := 32;
  end;
end;
(----------------------------------------------------------)