![]() |
wxIScan
|
An extended wxProcess based class. More...
#include <wxextprocess.h>
Public Member Functions | |
wxExtProcess (wxEvtHandler *poParent, int nId=-1) | |
Standard constructor copied from base class. | |
virtual | ~wxExtProcess () |
Virtual destructor. | |
virtual long | Execute (const wxString &strCommand, int nSync=wxEXEC_ASYNC) |
Execute the external process and save the process id. | |
virtual void | SetProcessId (long nProcessId) |
Set the process id of the external process. | |
virtual long | GetProcessId () |
Get the process id of the external process. | |
virtual wxKillError | Kill (wxSignal nSignal=wxSIGNONE, int nFlags=wxKILL_NOCHILDREN) |
"Kill" a running process. | |
Protected Attributes | |
long | m_nProcessId |
Holds the process id of the process. |
An extended wxProcess based class.
It extends wxProcess in a way that it is possible to kill an external process by saving the process id so you do not have to know it when you want to kill the process. Just call its member function Kill().
Definition at line 26 of file wxextprocess.h.
wxExtProcess::wxExtProcess | ( | wxEvtHandler * | poParent, |
int | nId = -1 |
||
) | [inline] |
Standard constructor copied from base class.
poParent | a pointer to the event handler parent |
nId | id of the wxEVT_END_PROCESS notification event |
Definition at line 33 of file wxextprocess.h.
: wxProcess( poParent, nId ), m_nProcessId( 0 ) { }
virtual wxExtProcess::~wxExtProcess | ( | ) | [inline, virtual] |
virtual long wxExtProcess::Execute | ( | const wxString & | strCommand, |
int | nSync = wxEXEC_ASYNC |
||
) | [inline, virtual] |
Execute the external process and save the process id.
strCommand | command to execute |
nSync | flag to indicate wether to execute the process synchronously or asynchronously |
Definition at line 48 of file wxextprocess.h.
References m_nProcessId.
Referenced by wxIScanFrame::Execute().
{ m_nProcessId= ::wxExecute( strCommand, nSync, this ); return m_nProcessId; }
virtual long wxExtProcess::GetProcessId | ( | ) | [inline, virtual] |
Get the process id of the external process.
Definition at line 63 of file wxextprocess.h.
References m_nProcessId.
Referenced by Kill().
{ return m_nProcessId; }
virtual wxKillError wxExtProcess::Kill | ( | wxSignal | nSignal = wxSIGNONE , |
int | nFlags = wxKILL_NOCHILDREN |
||
) | [inline, virtual] |
"Kill" a running process.
nSignal | signal (see description of wxProcess) |
nFlags | flags (see description of wxProcess) |
Definition at line 72 of file wxextprocess.h.
References GetProcessId().
Referenced by wxIScanFrame::OnCmdStop(), and wxIScanFrame::~wxIScanFrame().
{ return wxProcess::Kill( GetProcessId(), nSignal, nFlags ); }
virtual void wxExtProcess::SetProcessId | ( | long | nProcessId | ) | [inline, virtual] |
Set the process id of the external process.
nProcessId | process id of the external process |
Definition at line 57 of file wxextprocess.h.
References m_nProcessId.
{ m_nProcessId= nProcessId; }
long wxExtProcess::m_nProcessId [protected] |
Holds the process id of the process.
Definition at line 79 of file wxextprocess.h.
Referenced by Execute(), GetProcessId(), and SetProcessId().