How to get the Size of the Window having the Html document in the Webbrowser application
-
In the WebBrowser application how to get the size of the window which includes the Html document in it , and the scrollbars also. Regards Shikha NetStudio,Pune
-
In the WebBrowser application how to get the size of the window which includes the Html document in it , and the scrollbars also. Regards Shikha NetStudio,Pune
I guess your problem is scroll do you use CHtmlView?_**
**_
whitesky
-
In the WebBrowser application how to get the size of the window which includes the Html document in it , and the scrollbars also. Regards Shikha NetStudio,Pune
Shikha Jain wrote:
In the WebBrowser application how to get the size of the window which includes the Html document in it , and the scrollbars also.
is api GetWindowRect of any use?
"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
-
I guess your problem is scroll do you use CHtmlView?_**
**_
whitesky
Thanks for your reply . Yes, i have used the CHtmlView class in my application and i want the size of the html page document i can get size of the window with scrollbar by using getscrollinfo function but it is again not giving the size of the window having the html document. Regards Shikha Netstudio,Pune
-
Shikha Jain wrote:
In the WebBrowser application how to get the size of the window which includes the Html document in it , and the scrollbars also.
is api GetWindowRect of any use?
"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
Thanks for your reply, But GetClientRect() only gives the client area size of the window i want the whole page size of the html document i.e with the scrollbars also. Regards Shikha Netstudio,Pune
-
Thanks for your reply . Yes, i have used the CHtmlView class in my application and i want the size of the html page document i can get size of the window with scrollbar by using getscrollinfo function but it is again not giving the size of the window having the html document. Regards Shikha Netstudio,Pune
Did you see GetHeight and GetWidth in this class_**
**_
whitesky
-
Did you see GetHeight and GetWidth in this class_**
**_
whitesky
Yes i can get the GetHeight,GetWidth function but again from that just i can get the height of the window without scrollbars which is not the whole size of the html document. Regards Shikha Pune
-
Thanks for your reply, But GetClientRect() only gives the client area size of the window i want the whole page size of the html document i.e with the scrollbars also. Regards Shikha Netstudio,Pune
Actualy in the previous mail it is by mistake i have written GetClientRect . yes GetWindowRect you have suggested , i have tried that but it again gives the size of the window excluding the scrollbars i.e not the whole html document size . Regards Shikha Pune
-
In the WebBrowser application how to get the size of the window which includes the Html document in it , and the scrollbars also. Regards Shikha NetStudio,Pune
Supposing you actually need the full size of the HTML document, including the parts out of client area, a possible solution can look like this:
CComPtr< IHTMLDocument3 > doc = (IHTMLDocument3*)GetHtmlDocument(); IHTMLElement * doc_element; doc->get_documentElement(&doc_element); CComQIPtr<IHTMLElement2> element = doc_element; long width; long height; element->get_scrollWidth(&width); element->get_scrollHeight(&height);
Please note that the sizes are available only for fully loaded HTML documents, when
GetReadyState()
returns an appropriate value. Hope this is what you need in your HTML-capturing application.