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

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

#ifndef WclthreadHPP
#define WclthreadHPP

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

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

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

#pragma pack(pop)

//-- var, const, procedure ---------------------------------------------------
}	/* namespace Wclthread */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_WCLTHREAD)
using namespace Wclthread;
#endif
#pragma pack(pop)
#pragma option pop

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