need help on showing and hiding process
ok.. about hiding and showing window..
using simple coding it is able to hide simple windows like notepads.. firefox.. eg.. but i wanna hide a game window called Conquer.. it always crashes
CODE
private const int hiding = 0;
private const int restoring = 9;
private int numbers;
[DllImport("User32")]
private static extern int ShowWindow(int hwnd, int nCmdShow);
private void hide_Click(object sender, EventArgs e)
{
Process[] p = Process.GetProcessesByName("Conquer");
numbers = (int)p[0].MainWindowHandle;
ShowWindow(numbers, hiding);
}
private void restore_Click(object sender, EventArgs e)
{
Process[] p = Process.GetProcessesByName("Conquer");
numbers = (int)p[0].MainWindowHandle;
ShowWindow(numbers, restoring);
}
anyone know why?
i took a vid of it.. can view it here..
http://www.youtube.com/watch?v=EAcT_oOoQ1Y
when it finsh loading the load game thing showed for a 2nd time when i press hide.. its not suppose to be that way
most prob is a direct x error..