Handling windows of other processes
In this post, I am going to explain bringing a minimized window of other process to normal state. Inorder to do that, you need to use the ‘showwindow’ api from win32. The detailed code is given below,
private static extern int ShowWindow(int hwnd, int nCmdShow);
implement the ShowWindow in a method.
System.Diagnostics.Process mygameProcess = System.Diagnostics.Process.GetProcessesByName(“mygame”);
if (mygameProcess.Length > 0)
System.Diagnostics.Process proc = mygameProcess;
TvStarter.ShowWindow(proc.MainWindowHandle.ToInt32(), 1); //TvStarter is class name
this is very useful when you create an application which controls several other related applications in .Net.
No comments yet.