processlist Data property
Return to Introduction  Previous page  Next page
plies to
acProcess and acConnection objects.  

Declaration
property Data: Pointer;  

Description
The Data property specifies any application-specific data associated with the TacProcess object.  
 
Use Data to associate arbitrary data structure with the TacProcess object.  

Example
// Demonstrates how to fill the ListView with process entries  
// and associate ListItem with TacProcess object and otherwise, TacProcess with ListItem...  
procedure TForm1.Button1Click(Sender: TObject);  
var  
  I: Integer;  
  ListItem: TListItem;  
begin  
  ListView1.Items.BeginUpdate;  
  try  
    ListView1.Items.Clear;  
    I := acProcessList1.Count;  
    if I <> 0 then  
     for I := 0 to I - 1 do  
      begin  
       ListItem := ListView1.Items.Add;  
       ListItem.Caption := acProcessList1[I].ExeName;  
 
       // associate the Data pointer to TacProcess object and Data pointer of Process object to ListItem  
       ListItem.Data := acProcessList1[I];  
       acProcessList1[I].Data := ListItem;  
      end;  
  finally  
    ListView1.Items.EndUpdate;  
  end;  
end;