How to obtain process of newly created IE8 window?

前端 未结 2 652
深忆病人
深忆病人 2021-01-20 18:40

When using .NET\'s Process.Start to run IE8\'s iexplore.exe, and if you already have another IE8 window open, then the iexplore.exe process that you just started will immedi

2条回答
  •  离开以前
    2021-01-20 19:01

    I did it using a non-optimal solution - get a list of all iexplore.exe process IDs before running my iexplore.exe, then get the same list again after iexplore.exe is invoked. Do a diff between the two lists, the extra PID will be the one I've created. This of course won't work in certain cases (other apps or the user started extra iexplore.exe processes while the detection code is running, or IE did some kind of rearrange/recreation of processes as an internal maintenance task).

提交回复
热议问题