הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
Question
Saturday, November 9, 2013 1:34 PM
Sir,
i have already the below said code from How to programmatically close IE browser using VB.Net -
'Get the currentProcess MainWindowTitle and see if that title matches the title of the action cancelled IE instance:
if currentProcess.MainWindowTitle.Equals("title bar text here") then
currentProcess.Kill()
end if
next
Will above code close only IE, Chrome, Firefox, Opera particular tab containing title text "Ebay.in"?
please help.
All replies (2)
Saturday, November 9, 2013 3:19 PM ✅Answered
Sir,
i have already the below said code from How to programmatically close IE browser using VB.Net -
'Get the currentProcess MainWindowTitle and see if that title matches the title of the action cancelled IE instance:
if currentProcess.MainWindowTitle.Equals("title bar text here") then
currentProcess.Kill()
end if
next
Will above code close only IE, Chrome, Firefox, Opera particular tab containing title text "Ebay.in"?
please help.
It seems to me you will be killing the current process entirely and not just exiting a tab page of the process.
Also you say "tab containing title text "Ebay.in"?" so how do you use this " currentProcess.MainWindowTitle.Equals("title bar text here")" which says Equals when you actually want to know if it contains "Ebay.in"? Equals would mean the entire titlebars text. Contains would mean if the entire titlebars text has the string "Ebay.in" somewhere withiin it.
It seems to me you would have to "kill" the childhWnd to close the tab. In the image below the app shows the childhWnd for that tab that contains Ebay.in in its Main Window Title. But in this case it is the only tab opened in that instance of Internet Explorer so "killing" or closing that tab would shut down that instance of Internet Explorer.
I would recommend you study up a lot more on main windows which I believe is the entire application and child windows which I believe are the controls (buttons, tab pages, etc) of a main window before you attempt things that are obviously out of your scope of knowledge at this point. I know it's easier just to have someone give you the code to do what you want to do but what exactly would you learn from that? Not how or why it works that way! Oh you may get some "idea" on what it's doing but that doesn't mean the "idea" you would get would be accurate at all without already having some knowlege of what the working aspect of the code actually does.
Plus the links you posted "How to programmatically close IE browser using VB.Net" words describe closing an entire application so how do you confuse that with just closing a tab page? I haven't bothered to look at the link but the description of what it says has nothing to do with closing a tab page.
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.
Saturday, November 9, 2013 2:45 PM
Hi,
The link you showed is only an idea of the code for closing a whole program not just a tab on the programs window.