Created
June 28, 2011 05:34
-
-
Save mikeobrien/1050559 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DllImport("user32.dll")] | |
static extern int GetWindowThreadProcessId(IntPtr windowHandle, IntPtr processId); | |
public void Close() | |
{ | |
var threadId = GetWindowThreadProcessId(Browser.hWnd, IntPtr.Zero); | |
Process.GetProcessesByName("iexplore").First(x => x.Threads.Cast<ProcessThread>().Any(y => y.Id == threadId)).Kill(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment