I'm making a runescape toolkit for fun and I wanted to use the exe version of the client.
Everything works fine until i want to type something for some reason it doesn't register.
Clicking on buttons within the runescape client works just fine.
Does anyone have any experience with this?
All the relevant code:
Code:
private void button2_Click(object sender, EventArgs e)
{
startInfo.FileName ="C:/Users/Viktor/jagexcache/jagexlauncher/bin/JagexLauncher.exe";//C:/Users/Viktor/jagexcache/jagexlauncher/bin/JagexLauncher.exe";
startInfo.Arguments = "runescape";
Process p = Process.Start(startInfo);
while(p.MainWindowHandle.ToString().Equals("0") == true){
Thread.Sleep(600);
SetParent(p.MainWindowHandle, panel1.Handle);
}
}
[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);