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. Opening a web site from VC++ application

Opening a web site from VC++ application

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsonhelptutorialquestion
12 Posts 7 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.
  • M Offline
    M Offline
    megha_gharote
    wrote on last edited by
    #1

    Dear Friends, i just thought of opening a Website link from my VC++ application. how to do that can any body help me out plz? i just wanted to know are there any API with help of which i can open a web link? Megha

    N H P N 4 Replies Last reply
    0
    • M megha_gharote

      Dear Friends, i just thought of opening a Website link from my VC++ application. how to do that can any body help me out plz? i just wanted to know are there any API with help of which i can open a web link? Megha

      N Offline
      N Offline
      Nishad S
      wrote on last edited by
      #2

      ShellExecute(0, L"open", L"www.codeproject.com", NULL, NULL, SW_SHOWNORMAL);

      - NS -

      T 1 Reply Last reply
      0
      • M megha_gharote

        Dear Friends, i just thought of opening a Website link from my VC++ application. how to do that can any body help me out plz? i just wanted to know are there any API with help of which i can open a web link? Megha

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

        See CHtmlView and CDHtmlDialog classes.

        1 Reply Last reply
        0
        • M megha_gharote

          Dear Friends, i just thought of opening a Website link from my VC++ application. how to do that can any body help me out plz? i just wanted to know are there any API with help of which i can open a web link? Megha

          P Offline
          P Offline
          p_
          wrote on last edited by
          #4

          draw a sdi or any app but base class should be viewHtml and it has OnInitialUpdate() fun automaticlly change site name only code is: void CMyHtmlAppView::OnInitialUpdate() { CHtmlView::OnInitialUpdate(); Navigate2(_T("msdn.microsoft.com/visualc/"),NULL,NULL); } i think it help u

          M 1 Reply Last reply
          0
          • M megha_gharote

            Dear Friends, i just thought of opening a Website link from my VC++ application. how to do that can any body help me out plz? i just wanted to know are there any API with help of which i can open a web link? Megha

            N Offline
            N Offline
            nbugalia
            wrote on last edited by
            #5

            Use ShellExecute to open the website in internet explorer in the following way - ShellExecute (0, L"open", L"iexplore.exe", L"www.codeproject.com", NULL, SW_SHOWNORMAL);

            T 1 Reply Last reply
            0
            • N Nishad S

              ShellExecute(0, L"open", L"www.codeproject.com", NULL, NULL, SW_SHOWNORMAL);

              - NS -

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              NS17 wrote:

              ShellExecute(0, L"open", L"www.codeproject.com", NULL, NULL, SW_SHOWNORMAL);

              No. use L extension where you're certain that UNICODE is defined. the following should be more secure and extensible code :

              ::ShellExecute(NULL, _T("open"), _T("www.codeproject.com"), NULL, NULL, SW_SHOWNORMAL);


              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              N 1 Reply Last reply
              0
              • N nbugalia

                Use ShellExecute to open the website in internet explorer in the following way - ShellExecute (0, L"open", L"iexplore.exe", L"www.codeproject.com", NULL, SW_SHOWNORMAL);

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                NishantB++ wrote:

                ShellExecute (0, L"open", L"iexplore.exe", L"www.codeproject.com", NULL, SW_SHOWNORMAL);

                nope, for 2 reasons. 1) dont force the user to use internet explorer if he defined firefox (or any other) to be the default browser. 2) don't use the L extension unless you're certain that UNICODE is defined. read my other post[^] about that point.


                [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                N 1 Reply Last reply
                0
                • P p_

                  draw a sdi or any app but base class should be viewHtml and it has OnInitialUpdate() fun automaticlly change site name only code is: void CMyHtmlAppView::OnInitialUpdate() { CHtmlView::OnInitialUpdate(); Navigate2(_T("msdn.microsoft.com/visualc/"),NULL,NULL); } i think it help u

                  M Offline
                  M Offline
                  megha_gharote
                  wrote on last edited by
                  #8

                  thank u so much.. it worked.. i m creating one application to make task of filling timesheet bit easier for my team members... thank u once again. Megha

                  1 Reply Last reply
                  0
                  • T toxcct

                    NS17 wrote:

                    ShellExecute(0, L"open", L"www.codeproject.com", NULL, NULL, SW_SHOWNORMAL);

                    No. use L extension where you're certain that UNICODE is defined. the following should be more secure and extensible code :

                    ::ShellExecute(NULL, _T("open"), _T("www.codeproject.com"), NULL, NULL, SW_SHOWNORMAL);


                    [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                    N Offline
                    N Offline
                    Nishad S
                    wrote on last edited by
                    #9

                    Oops I didnt notice that when I copy-paste... :)

                    - NS -

                    1 Reply Last reply
                    0
                    • T toxcct

                      NishantB++ wrote:

                      ShellExecute (0, L"open", L"iexplore.exe", L"www.codeproject.com", NULL, SW_SHOWNORMAL);

                      nope, for 2 reasons. 1) dont force the user to use internet explorer if he defined firefox (or any other) to be the default browser. 2) don't use the L extension unless you're certain that UNICODE is defined. read my other post[^] about that point.


                      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                      N Offline
                      N Offline
                      nbugalia
                      wrote on last edited by
                      #10

                      toxcct wrote:

                      dont force the user to use internet explorer

                      I already mentioned that - "open the website in internet explorer " The second reason was only because of C:)PY PASTE. Sorry for that.

                      T 1 Reply Last reply
                      0
                      • N nbugalia

                        toxcct wrote:

                        dont force the user to use internet explorer

                        I already mentioned that - "open the website in internet explorer " The second reason was only because of C:)PY PASTE. Sorry for that.

                        T Offline
                        T Offline
                        toxcct
                        wrote on last edited by
                        #11

                        but why do you not let the system choose the default browser ?


                        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                        S 1 Reply Last reply
                        0
                        • T toxcct

                          but why do you not let the system choose the default browser ?


                          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                          S Offline
                          S Offline
                          Signal 9
                          wrote on last edited by
                          #12

                          some people dont want choice it seems...:confused:

                          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