[c#]
Hello guys,
I tried last days, 6 full days exactly, to solve my problem , no succes.
On mostly examples here and on the web we can see that :
[samevoid,except statics]
Open Process
Read,Write .....
Close Handle
But i need to acces to the process into 3 threads , but when i try, sometime that's say "Process Not opened" .
That's not the real code , it's just to give a idea of what i mean.
Code:
public partial class Test : Form
{
public IntPtr Process;
private void Test_Load(object sender, EventArgs e)
{
Process[] processes = Process.GetProcessesByName("wow");
OpenProcess(DesiredAccess, 0, Process[0])
new Thread(new ThreadStart(ThreadTest1));
new Thread(new ThreadStart(ThreadTest2));
new Thread(new ThreadStart(ThreadTest3));
new Thread(new ThreadStart(ThreadTest4));
}
public void ThreadTest1()
{
Log("Thread 1" + Convert.ToString(CheckIntPtrProcessOpened(Process)))
}
public void ThreadTest2()
{
Log("Thread 2" + Convert.ToString(CheckIntPtrProcessOpened(Process)))
}
public void ThreadTest3()
{
Log("Thread 3" + Convert.ToString(CheckIntPtrProcessOpened(Process)))
}
public void ThreadTest4()
{
Log("Thread 4" + Convert.ToString(CheckIntPtrProcessOpened(Process)))
}
}
First Test Result :
Code:
Thread 1True
Thread 4False
Thread 2False
Thread 3False
Second Test Result :
Code:
Thread 3True
Thread 4true
Thread 2False
Thread 1False
Third Test Result :
Code:
Thread 3False
Thread 4False
Thread 2False
Thread 1False
So, that suck a lot , and i not understand why sometime all is well , sometime not ......
I really hope someone have an issue, i spent 6days on .........
Thanks