// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ahmtcmdpipe.pas' rev: 6.00

#ifndef ahmtcmdpipeHPP
#define ahmtcmdpipeHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Forms.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Ahmtcmdpipe
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TAHMReadPipeEvent)(System::TObject* Sender, AnsiString aData);

class DELPHICLASS TAHMCmdThread;
class DELPHICLASS TAHMCmdPipe;
class PASCALIMPLEMENTATION TAHMCmdPipe : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	unsigned fhProcess;
	unsigned fhThread;
	TAHMReadPipeEvent fOnReceiveData;
	unsigned fExitCode;
	TAHMCmdThread* fCmdThread;
	Classes::TNotifyEvent fOnFinished;
	TAHMReadPipeEvent fOnErrorData;
	bool __fastcall GetIsActive(void);
	
protected:
	virtual void __fastcall RemoveProcessors(void);
	virtual void __fastcall FinishProcess(void);
	__property TAHMCmdThread* CndThread = {read=fCmdThread};
	
public:
	__fastcall virtual TAHMCmdPipe(Classes::TComponent* AOwner);
	__fastcall virtual ~TAHMCmdPipe(void);
	virtual void __fastcall SendData(AnsiString aData);
	virtual void __fastcall ReceiveData(AnsiString aData);
	virtual void __fastcall Execute(AnsiString aCommandLine, AnsiString aDefaultPath);
	__property unsigned ExitCode = {read=fExitCode, nodefault};
	__property bool IsActive = {read=GetIsActive, nodefault};
	
__published:
	__property TAHMReadPipeEvent OnReceiveData = {read=fOnReceiveData, write=fOnReceiveData};
	__property TAHMReadPipeEvent OnErrorData = {read=fOnErrorData, write=fOnErrorData};
	__property Classes::TNotifyEvent OnFinished = {read=fOnFinished, write=fOnFinished};
};


class PASCALIMPLEMENTATION TAHMCmdThread : public Classes::TThread 
{
	typedef Classes::TThread inherited;
	
private:
	TAHMCmdPipe* fCmdPipe;
	AnsiString fData;
	unsigned fStdOutRead;
	unsigned fStdOutWrite;
	AnsiString fWriteBuffer;
	unsigned fStdInRead;
	unsigned fStdInWrite;
	unsigned fStdErrorIn;
	unsigned fStdErrorOut;
	
public:
	__fastcall virtual TAHMCmdThread(TAHMCmdPipe* ACmdPipe);
	virtual void __fastcall SendData(AnsiString aData);
	void __fastcall ReceivedData(void);
	void __fastcall ErrorData(void);
	virtual void __fastcall Execute(void);
	__fastcall virtual ~TAHMCmdThread(void);
	__property unsigned StdOutRead = {read=fStdOutRead, nodefault};
	__property unsigned StdOutWrite = {read=fStdOutWrite, nodefault};
	__property unsigned StdInRead = {read=fStdInRead, nodefault};
	__property unsigned StdInWrite = {read=fStdInWrite, nodefault};
	__property unsigned StdErrorIn = {read=fStdErrorIn, nodefault};
	__property unsigned StdErrorOut = {read=fStdErrorOut, nodefault};
	__property TAHMCmdPipe* CmdPipe = {read=fCmdPipe};
};


//-- var, const, procedure ---------------------------------------------------
static const Word aMaxDWord = 0x3ff;

}	/* namespace Ahmtcmdpipe */
using namespace Ahmtcmdpipe;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ahmtcmdpipe
