// CodeGear C++Builder
// Copyright (c) 1995, 2010 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'wclThread.pas' rev: 22.00

#ifndef WclthreadHPP
#define WclthreadHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <wclMessaging.hpp>	// Pascal unit
#include <wclErrors.hpp>	// Pascal unit
#include <wclWinAPI.hpp>	// Pascal unit

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

namespace Wclthread
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TwclThread;
class PASCALIMPLEMENTATION TwclThread : public System::TObject
{
	typedef System::TObject inherited;
	
private:
	_RTL_CRITICAL_SECTION FCS;
	unsigned FInitEvent;
	int FInitResult;
	unsigned FMsg;
	Wclmessaging::TwclMessageReceiver* FReceiver;
	unsigned FSyncEvent;
	Wclmessaging::TwclMessageReceiver* FSyncReceiver;
	unsigned FTermEvent;
	unsigned FThread;
	HWND FWnd;
	bool __fastcall GetRunning(void);
	int __fastcall StartThread(const System::TThreadFunc Proc);
	void __fastcall StopThread(void);
	void __fastcall SyncMessageReceived(const Wclmessaging::TwclMessage* Message);
	void __fastcall WndThreadProc(void);
	bool __fastcall WndProc(unsigned uMsg, int wParam, int lParam);
	int __fastcall RunWndThread(void);
	void __fastcall ApcOrSeparateThread(void);
	int __fastcall RunApcOrSeparateThread(void);
	
protected:
	int __fastcall Synchronize(const void * Param);
	virtual void __fastcall MessageReceived(const Wclmessaging::TwclMessage* Message);
	virtual bool __fastcall OnInitialize(void);
	virtual void __fastcall OnSignal(const System::Byte Id);
	virtual void __fastcall OnSynchronize(const void * Param);
	virtual void __fastcall OnTerminate(void);
	
public:
	__fastcall virtual TwclThread(void);
	__fastcall virtual ~TwclThread(void);
	int __fastcall Run(void);
	int __fastcall Signal(const System::Byte Id);
	int __fastcall Terminate(void);
	__property bool Running = {read=GetRunning, nodefault};
};


//-- var, const, procedure ---------------------------------------------------

}	/* namespace Wclthread */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE)
using namespace Wclthread;
#endif
#pragma pack(pop)
#pragma option pop

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