Hi Guys,
I'm porting a project from Delphi to Lazarus and there are some problems with shell execution.
the code:
procedure RunAndWaitShell(Executable, Parameter: STRING; ShowParameter: INTEGER);
var
Info: TShellExecuteInfo;
pInfo: pShellExecuteInfo;
exitCode: DWord;
begin
pInfo := @Info;
if (debug<>'false') then
begin
ShowParameter:=0;
end;
with Info do
begin
cbSize := SizeOf(Info);
fMask := SEE_MASK_NOCLOSEPROCESS;
wnd := application.Handle;
lpVerb := NIL;
lpFile := PChar(Executable);
lpParameters := PChar(Parameter + #0);
lpDirectory := NIL;
nShow := ShowParameter;
hInstApp := 0;
end;
ShellExecuteEx(pInfo);
repeat
exitCode := WaitForSingleObject(Info.hProcess, 500);
Application.ProcessMessages;
until (exitCode <> WAIT_TIMEOUT);
end;
the error:
Error: Identifier not found "pShellExecuteInfo"
Maybe pShellExecuteInfo is only supported for Delphi or something like that. Is there anything to handle this in lazarus?
Regards, ac