0

Could anyone help to how to deal with "SwitchToThisWindow" on the process which from rundll32.exe? thanks.

As below image: “Internet Properties” is under “Rundll32”, I have PID 3368 for rundll32.exe and use below code to put the process on top. But cannot switch “Internet Properties” to top.

Process process = Process.GetProcessById(pid);
SwitchToThisWindow(process.MainWindowHandle, true);

private static extern void SwitchToThisWindow(IntPtr hWnd, bool turnon);

enter image description here

Jason Ni
  • 159
  • 1
  • 1
  • 8
  • [This post](http://stackoverflow.com/questions/12984556/switchtothiswindow) mentions an extra call to `SetWindowPos` is needed to force the window on top. – Chris O Dec 18 '15 at 02:47
  • that is another method to fixed this issue. use FindWindows function. not get handle by process id, but this can fix my issue. thank you very much. – Jason Ni Dec 18 '15 at 21:37

0 Answers0