here is my way to do this:
using my connect class i can access everything i need in a specific wow pid
Code:
public class Connect
{
public Memory mem;
public ObjectManager obj;
public SendKey key;
private int pid;
private IntPtr hwnd;
private string name;
public Connect(int process)
{
this.hwnd = SWindow.FindWindowByProcessId(process);
mem = new Memory(process);
obj = new ObjectManager(mem);
key = new SendKey(this.hwnd);
this.pid = process;
this.name = obj.info.LocalName;
}
public int PID
{
get { return this.pid; }
}
public IntPtr HWND
{
get { return this.hwnd; }
}
public string NAME
{
get { return this.name; }
}
}
i my frame class i just create a list of these connect classes and set them as the datagridview datasource, then they will be displayed:
Code:
private List<Connect> ptr = new List<Connect>();
int[] pids = SProcess.GetProcessesFromClassname("GxWindowClassD3d");
foreach (int pid in pids)
{
ptr.Add(new Connect(pid));
}
this.dataGridView_Process.DataSource = this.ptr;
this.dataGridView_Process.Rows[0].Selected = true;
then i can select a line and call the databounditem (my connect class) like this:
((Connect)this.dataGridView_Process.SelectedRows[0].DataBoundItem).obj.LocalPlayer.TargetGuid
which would get the info from the selected wow, in this example the localplayer target guid