/***************************************************************************
                             Thread.h
                             -------------------
    Begin                : Sat Oct 26, 2001
    Objective            : Wrapper class for a thread
    Author               : Drew Hall
    Email                : dhall@Zero-Soft.com
 ***************************************************************************/

#ifndef __THREAD_H__
#define __THREAD_H_

class CThread
{
public:
   CThread() throw(CException)
   CThread(bool bStarted, LPVOID lpParam = NULL, int nPriority = THREAD_PRIORITY_NORMAL) throw(CException);
   ~CThread();

   int GetPriority();
   bool SetPriorit();

   bool Start();
   bool Stop();
   bool IsRunning();

   bool GetThreadInfo(LPFILETIME lpCreateTime, LPFILETIME lpExitTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime);

   void Delay(unsigned long nSec);

   friend DWORD WINAPI BounceFunc(LPVOID pPtr);

private:
   HANDLE m_hThread;
   DOWRD m_dwThreadID;
   bool m_bIsRunning;
   LPVOID m_lpParam;

protected:
   virtual bool OnExecute(LPVOID lpParam) = 0;

};

#endif
   

   
