#ifndef __OOL_XPROCES_H__
#define __OOL_XPROCES_H__

/*===========================================================================*/
/* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
/*===========================================================================*/
/*                              class: XProcess                              */
/*                       derived from: XObject                               */
/*                        last update: 4/97                                  */
/*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
/*===========================================================================*/



#include "xobject.h"

class XWindow;
class XString;

#ifdef OOL_FOR_OS2_X86
   #define EXE_SYNC       EXEC_SYNC
   #define EXE_ASYNC      EXEC_ASYNC
#endif

class _export_ XProcess: public XObject
{
      friend class XResourceLibrary;
      friend class XHelpInstance;
      friend class XFrameWindow;
      friend class XUserWindow;
		friend class XPrinterDevice;
      friend class XProfile;
		friend class XModelessDialog;
		friend class XModalDialog;
		friend class XDialog;
   protected:
      HAB hab;
      HMQ queue;
      QMSG messagequeue;
      SHORT windows;
      XWindow ** frames;
      void AddWindow( const XWindow * );
      void RemoveWindow( const XWindow*);
   public:
      XProcess();
      virtual ~XProcess() {;}
      static void Beep( const LONG f, const LONG d);
		static void EnterCriticSection();
      static LONG ExecuteProg( const char * path, const char * args, const char * env, const ULONG flag, LONG * result);
		static void LeaveCriticSection();
      virtual BOOL QueryForQuit( void );
      static BOOL ScanEnvironment( const char * valueToSearch, XString * buffer);
      static void Sleep( const LONG d);
      void Start( void );
      virtual void Terminate( void );
};

#endif
