Closing a invisible web browser
-
Hi, Is there a way to close an invisible web browser? how do i detect the web browser and close it?? Thanks!!
You have to do COM Programming. Interface of Internet Explorer com object is IWebBrowser2. You have to get the invisile instance of IE by calling CoGetObject() COM API. Then you can call it's interface methods to close the Invisible Browser. Once you get the COM instance of API. Then call the COM method ExecWB of IWebBrowser2 with parameter OLECMDID_CLOSE. Then the invisible browser will be closed. OK ? Regards, Benoy Bose
-
You have to do COM Programming. Interface of Internet Explorer com object is IWebBrowser2. You have to get the invisile instance of IE by calling CoGetObject() COM API. Then you can call it's interface methods to close the Invisible Browser. Once you get the COM instance of API. Then call the COM method ExecWB of IWebBrowser2 with parameter OLECMDID_CLOSE. Then the invisible browser will be closed. OK ? Regards, Benoy Bose
-
Hi, Is there a way to close an invisible web browser? how do i detect the web browser and close it?? Thanks!!
KongHL wrote:
Is there a way to close an invisible web browser? how do i detect the web browser and close it??
Are you sure there is Invisble Webbrowser
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
KongHL wrote:
Is there a way to close an invisible web browser? how do i detect the web browser and close it??
Are you sure there is Invisble Webbrowser
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
KongHL wrote:
U can create IWebBrowser2 object and make it visible or invisible..
your Answer is hidden in this object!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
-
KongHL wrote:
U can create IWebBrowser2 object and make it visible or invisible..
your Answer is hidden in this object!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You
?? The problem is i created the browser in a dll (in a thread).. when i tried to terminate the thread, the browser is not closed via the quit() function. Hence I am trying to close in in the main program.. but this way, i dun have the instance of it.. I need to find it and close it right?
-
?? The problem is i created the browser in a dll (in a thread).. when i tried to terminate the thread, the browser is not closed via the quit() function. Hence I am trying to close in in the main program.. but this way, i dun have the instance of it.. I need to find it and close it right?
KongHL wrote:
The problem is i created the browser in a dll (in a thread).. when i tried to terminate the thread, the browser is not closed via the quit() function. Hence I am trying to close in in the main program.. but this way, i dun have the instance of it.. I need to find it and close it right?
Why Not have that Variable of Webbrowser as Class member and pass the current instance of class object to thread, and using that Variable so that you can manipulate the browser from teh Main program.. don't forget to add CoInitialize(NULL)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You