Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get the Size of the Window having the Html document in the Webbrowser application

How to get the Size of the Window having the Html document in the Webbrowser application

Scheduled Pinned Locked Moved C / C++ / MFC
htmltutorial
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anamika2005
    wrote on last edited by
    #1

    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

    H T V 3 Replies Last reply
    0
    • A Anamika2005

      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

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      I guess your problem is scroll do you use CHtmlView?_**


      **_

      whitesky


      A 1 Reply Last reply
      0
      • A Anamika2005

        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

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        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

        A 1 Reply Last reply
        0
        • H Hamid Taebi

          I guess your problem is scroll do you use CHtmlView?_**


          **_

          whitesky


          A Offline
          A Offline
          Anamika2005
          wrote on last edited by
          #4

          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

          H 1 Reply Last reply
          0
          • T ThatsAlok

            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

            A Offline
            A Offline
            Anamika2005
            wrote on last edited by
            #5

            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

            A 1 Reply Last reply
            0
            • A Anamika2005

              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

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              Did you see GetHeight and GetWidth in this class_**


              **_

              whitesky


              A 1 Reply Last reply
              0
              • H Hamid Taebi

                Did you see GetHeight and GetWidth in this class_**


                **_

                whitesky


                A Offline
                A Offline
                Anamika2005
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • A Anamika2005

                  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

                  A Offline
                  A Offline
                  Anamika2005
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0
                  • A Anamika2005

                    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

                    V Offline
                    V Offline
                    Viorel
                    wrote on last edited by
                    #9

                    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.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups