TCnProcess Class
Provides access to local and remote processes and enables you to start and stop local system processes.
type TCnProcess = class(TClrBaseComponent) end;
The TCnProcess type exposes the following members.
Name | Description | |
---|---|---|
Create(TComponent) | Creates and initializes a TCnProcess instance. (Overrides TClrBaseComponent.Create(TComponent).) | |
Destroy | Frees the resources allocated with a TCnProcess instance. (Overrides TClrBaseComponent.Destroy.) |
Name | Description | |
---|---|---|
BasePriority | Gets the base priority of the associated process. | |
DefaultClrObject | Get the common language runtime object interface for this component. (Inherited from TClrBaseComponent.) | |
EnableRaisingEvents | Gets or sets whether the OnExited event should be raised when the process terminates. | |
ExitCode | Gets the value that the associated process specified when it terminated. | |
ExitTime | Gets the time that the associated process exited. | |
Handle | Gets the native handle of the associated process. | |
HandleCount | Gets the number of handles opened by the process. | |
HasExited | Gets a value indicating whether the associated process has been terminated. | |
Id | Gets the unique identifier for the associated process. | |
MachineName | Gets the name of the computer the associated process is running on. | |
MainModule | Gets the main module for the associated process. | |
MainWindowHandle | Gets the window handle of the main window of the associated process. | |
MainWindowTitle | Gets the caption of the main window of the process. | |
MaxWorkingSet | Gets or sets the maximum allowable working set size, in bytes, for the associated process. | |
MinWorkingSet | Gets or sets the minimum allowable working set size, in bytes, for the associated process. | |
Modules | Gets the modules that have been loaded by the associated process. | |
NonpagedSystemMemorySize64 | Gets the amount of nonpaged system memory, in bytes, allocated for the associated process. | |
PagedMemorySize64 | Gets the amount of paged memory, in bytes, allocated for the associated process. | |
PagedSystemMemorySize64 | Gets the amount of pageable system memory, in bytes, allocated for the associated process. | |
PeakPagedMemorySize64 | Gets the maximum amount of memory in the virtual memory paging file, in bytes, used by the associated process. | |
PeakVirtualMemorySize64 | Gets the maximum amount of virtual memory, in bytes, used by the associated process. | |
PeakWorkingSet64 | Gets the maximum amount of physical memory, in bytes, used by the associated process. | |
PriorityBoostEnabled | Gets or sets a value indicating whether the associated process priority should temporarily be boosted by the operating system when the main window has the focus. | |
PriorityClass | Gets or sets the overall priority category for the associated process. | |
PrivateMemorySize64 | Gets the amount of private memory, in bytes, allocated for the associated process. | |
PrivilegedProcessorTime | Gets the privileged processor time for this process. | |
Process | Gets the .Net Process object as interface. | |
ProcessName | Gets the name of the process. | |
ProcessorAffinity | Gets or sets the processors on which the threads in this process can be scheduled to run. | |
Responding | Gets a value indicating whether the user interface of the process is responding. | |
SessionId | Gets the Terminal Services session identifier for the associated process. | |
StandardError | Gets a stream used to read the error output of the application. | |
StandardInput | Gets a stream used to write the input of the application. | |
StandardOutput | Gets a stream used to read the textual output of the application. | |
StartInfo | Gets or sets the properties to pass to the Start() method of the Process. | |
StartTime | Gets the time that the associated process was started. | |
SynchronizingObject | Gets or sets the object used to marshal the event handler calls that are issued as a result of a process exit event. | |
Threads | Gets the set of threads that are running in the associated process. | |
TotalProcessorTime | Gets the total processor time for this process. | |
UserProcessorTime | Gets the user processor time for this process. | |
VirtualMemorySize64 | Gets the amount of the virtual memory, in bytes, allocated for the associated process. | |
WorkingSet64 | Gets the amount of physical memory, in bytes, allocated for the associated process. |
Name | Description | |
---|---|---|
BeginErrorReadLine | Begins asynchronous read operations on the redirected StandardError stream of the application. | |
BeginOutputReadLine | Begins asynchronous read operations on the redirected StandardOutput stream of the application. | |
CancelErrorRead | Cancels the asynchronous read operation on the redirected StandardError stream of an application. | |
CancelOutputRead | Cancels the asynchronous read operation on the redirected StandardOutput stream of an application. | |
Close | Frees all the resources that are associated with this component. | |
CloseMainWindow | Closes a process that has a user interface by sending a close message to its main window. | |
Dispose | Releases the resources used by the Component. (Inherited from TClrBaseComponent.) | |
DoGetDefaultClrObject | Represents method | |
DoGetDotNetBaseComponent | Represents method | |
EnterDebugMode | Puts a TCnProcess component in state to interact with operating system processes that run in a special mode by enabling the native property SetDebugPrivilege on the current thread. | |
GetClrObject | Represents method | |
GetCurrentProcess | Gets a new Process component and associates it with the currently active process. | |
GetProcessById(Integer) | Overloaded. Returns a new Process component, given the identifier of a process on the local computer. | |
GetProcessById(Integer,String) | Overloaded. Returns a new Process component, given a process identifier and the name of a computer on the network. | |
GetProcesses | Overloaded. Creates a new Process component for each process resource on the local computer. | |
GetProcesses(String) | Overloaded. Creates a new Process component for each process resource on the specified computer. | |
GetProcessesByName(String) | Overloaded. Creates an array of new Process components and associates them with all the process resources on the local computer that share the specified process name. | |
GetProcessesByName(String,String) | Overloaded. Creates an array of new Process components and associates them with all the process resources on a remote computer that share the specified process name. | |
Kill | Immediately stops the associated process. | |
LeaveDebugMode | Takes a TCnProcess component out of the state that lets it interact with operating system processes that run in a special mode. | |
Refresh | Discards any information about the associated process that has been cached inside the process component. | |
RegisterEventCallBack(ClrWString,Pointer) | Add an event to the instance using the specified event name and function pointer which is the event handler. The RegisterEventCallBack method does not directly add the event handler to the event. A hooking mechanism is used such that if the event is fired, the hook event is also fired which in turn calls the function pointer. (Inherited from TClrBaseComponent.) | |
RegisterEventSource | Register the Delphi object which will raise the .Net event handler. (Inherited from TClrBaseComponent.) | |
Start | Overloaded. Starts (or reuses) the process resource that is specified by the StartInfo property of this Process component and associates it with the component. | |
Start(String) | Overloaded. Starts a process resource by specifying the name of a document or application file and associates the resource with a new TCnProcess component. | |
Start(String,String) | Overloaded. Starts a process resource by specifying the name of an application and a set of command-line arguments, and associates the resource with a new TCnProcess component. | |
Start(String,String,String,String) | Overloaded. Starts a process resource by specifying the name of an application, a user name, a password, and a domain and associates the resource with a new TCnProcess component. | |
Start(String,String,String,String,String) | Overloaded. Starts a process resource by specifying the name of an application, a set of command-line arguments, a user name, a password, and a domain and associates the resource with a new TCnProcess component. | |
Start(TClrProcessStartInfo) | Overloaded. Starts the process resource that is specified by the parameter containing process start information (for example, the file name of the process to start) and associates the resource with a new TCnProcess component. | |
Start(_ProcessStartInfo) | Overloaded. Starts the process resource that is specified by the parameter containing process start information (for example, the file name of the process to start) and associates the resource with a new TCnProcess component. | |
UnRegisterEventCallBack(ClrWString,Pointer) | Remove an event from the instance using the specified event name and function pointer which is the event handler. (Inherited from TClrBaseComponent.) | |
UnRegisterEventSource | Unregister the Delphi object which raised the .Net event handler. (Inherited from TClrBaseComponent.) | |
WaitForExit | Overloaded. Instructs the Process component to wait indefinitely for the associated process to exit. | |
WaitForExit(Integer) | Overloaded. Instructs the Process component to wait the specified number of milliseconds for the associated TCnProcess to exit. | |
WaitForInputIdle | Overloaded. Causes the TCnProcess component to wait indefinitely for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop. | |
WaitForInputIdle(Integer) | Overloaded. Causes the TCnProcess component to wait the specified number of milliseconds for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop. |
Name | Description | |
---|---|---|
OnErrorDataReceived | Occurs when an application writes to its redirected StandardError stream. | |
OnExited | Occurs when a process exits. | |
OnOutputDataReceived | Occurs each time an application writes a line to its redirected StandardOutput stream. |
See C:\Users\Public\Documents\CrystalNet Technologies\.Net VCL for Delphi Demo Folder after installation for examples of how to use this component.