Switch to another window using C#

public static extern void SwitchToThisWindow(IntPtr hWnd,bool turnon);
String ProcWindow = "wechat";
private void switchToWechart()
    Process[] procs = Process.GetProcessesByName(ProcWindow);
    foreach (Process proc in procs)
         //switch to process by name
         SwitchToThisWindow(proc.MainWindowHandle, true);
Wangxin -->


I am algorithm engineer focused in computer vision, I know it will be more elegant to shut up and show my code, but I simply can't stop myself learning and explaining new things ...