procedure THIWinExec.Read;
var Total:dword; bWait:boolean; hWait:THandle; bError:boolean;
// pBuffer: array[0..1024] of char;
pBuffer: string;
begin
pBuffer := ';
hWait := CreateEvent(nil,false,false,nil); bError := false;
while FRead and not bError do begin
bWait := true;
if not PeekNamedPipe(hPipeErrorsRead,nil,0,nil,@Total,nil) then bError := true;
if Total>0 then begin
bWait := false;
SetLength(pBuffer, Total);
if ReadFile(hPipeErrorsRead, pBuffer[1], Total, Total, nil) then begin
// pBuffer[Total] := #0;
_hi_OnEvent(_event_onConsoleError, pBuffer);
end;
end;
if not PeekNamedPipe(hPipeOutputRead,nil,0,nil,@Total,nil) then bError := true;
if Total>0 then begin
bWait := false;
SetLength(pBuffer, Total);
if ReadFile(hPipeOutputRead, pBuffer[1], Total, Total, nil) then begin
// pBuffer[Total] := #0;
_hi_OnEvent(_event_onConsoleResult, pBuffer);
end;
end;
if bWait then WaitForSingleObject(hWait,1);
end;
CloseHandle(hWait);
if bError then begin
Terminate;
_hi_OnEvent(_event_onConsoleTerminate);
end;
end;
г. ость писал(а):
ещё бы так назойливо не мигалоТак то частая перерисовка. Можно попробовать полечить Label-ом с нулевым размером и включенной прозрачностью