Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I kill a particular chrome tab/process

I am writing a windows service that I would like to run as a scheduled task. On Start I want it to read in the chrome processes and kill any that have a particular url..

I can get the processes using

var list = Process.GetProcessesByName("chrome");

but after that I am stumped..

The MainWindowTitle of each process is "" and the MainWindowHandle is 0 so doesn't help me.

I have read numerous posts related to this and it seems there is no api into chrome so am I wasting my time?

Any help appreciated J

like image 492
John Avatar asked Oct 22 '22 12:10

John


1 Answers

If you look at spy++ you can see that you can find root windows that do have their Caption set to the html page title. Also a child window is the url bar so if you enum the child windows of all the chrome windows you uld be able to find it.

shoSpy++ Chome INfo

like image 197
rerun Avatar answered Oct 26 '22 23:10

rerun