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. Using ShellExecute to open a web page as a child of Dialog

Using ShellExecute to open a web page as a child of Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
14 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.
  • P pix_programmer

    Hi! I've to open a web page inside a Dialog(not as a popup) using ShellExecute. I've to use ShellExecute why because Navigate() function works only if IE is present in a System.Is this possible with ShellExecute? Or is there any other alternative?

    B Offline
    B Offline
    barneyman
    wrote on last edited by
    #2

    you can't use ShellExecute like that look at this, http://msdn.microsoft.com/en-us/library/aa752041(v=VS.85).aspx[^] It'll show you how to embed a browser as a control in your dialog

    P 1 Reply Last reply
    0
    • B barneyman

      you can't use ShellExecute like that look at this, http://msdn.microsoft.com/en-us/library/aa752041(v=VS.85).aspx[^] It'll show you how to embed a browser as a control in your dialog

      P Offline
      P Offline
      pix_programmer
      wrote on last edited by
      #3

      barneyman wrote:

      you can't use ShellExecute like that

      Ok. I realized that after posting the topic. Now what I want is to open my web page in a separate browser window. I don't want to open inside an already opened window. How to do this with ShellExecute?

      B 1 Reply Last reply
      0
      • P pix_programmer

        barneyman wrote:

        you can't use ShellExecute like that

        Ok. I realized that after posting the topic. Now what I want is to open my web page in a separate browser window. I don't want to open inside an already opened window. How to do this with ShellExecute?

        B Offline
        B Offline
        barneyman
        wrote on last edited by
        #4

        http://support.microsoft.com/kb/224816[^]

        P 1 Reply Last reply
        0
        • B barneyman

          http://support.microsoft.com/kb/224816[^]

          P Offline
          P Offline
          pix_programmer
          wrote on last edited by
          #5

          I can understand what's said there. But I don't know what parameter values to pass to ShellExecute to accomplish my task. I need some information about parameters(change in coding).

          B 1 Reply Last reply
          0
          • P pix_programmer

            I can understand what's said there. But I don't know what parameter values to pass to ShellExecute to accomplish my task. I need some information about parameters(change in coding).

            B Offline
            B Offline
            barneyman
            wrote on last edited by
            #6

            ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL);

            replace www.microsoft.com with where you want to go to

            P 1 Reply Last reply
            0
            • B barneyman

              ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL);

              replace www.microsoft.com with where you want to go to

              P Offline
              P Offline
              pix_programmer
              wrote on last edited by
              #7

              This opens inside an already opened window. I want to open the web page in a separate browser window.

              B 1 Reply Last reply
              0
              • P pix_programmer

                This opens inside an already opened window. I want to open the web page in a separate browser window.

                B Offline
                B Offline
                barneyman
                wrote on last edited by
                #8

                try

                ShellExecute(NULL, "open", "http://www.microsoft.com", "-new", NULL, SW_SHOWNORMAL);

                P 1 Reply Last reply
                0
                • B barneyman

                  try

                  ShellExecute(NULL, "open", "http://www.microsoft.com", "-new", NULL, SW_SHOWNORMAL);

                  P Offline
                  P Offline
                  pix_programmer
                  wrote on last edited by
                  #9

                  This opens in a new browser window if already an window is not there. If it's there, my web page is opened in the exisiting browser window. Can we have control over the size of the browser with ShellExecute?

                  B D 2 Replies Last reply
                  0
                  • P pix_programmer

                    This opens in a new browser window if already an window is not there. If it's there, my web page is opened in the exisiting browser window. Can we have control over the size of the browser with ShellExecute?

                    B Offline
                    B Offline
                    barneyman
                    wrote on last edited by
                    #10

                    unfortunately, you don't have a lot of control

                    1 Reply Last reply
                    0
                    • P pix_programmer

                      This opens in a new browser window if already an window is not there. If it's there, my web page is opened in the exisiting browser window. Can we have control over the size of the browser with ShellExecute?

                      D Offline
                      D Offline
                      David Crow
                      wrote on last edited by
                      #11

                      pix_programmer wrote:

                      Can we have control over the size of the browser with ShellExecute?

                      Isn't that what the sixth argument is for?

                      "One man's wage rise is another man's price increase." - Harold Wilson

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                      P 1 Reply Last reply
                      0
                      • D David Crow

                        pix_programmer wrote:

                        Can we have control over the size of the browser with ShellExecute?

                        Isn't that what the sixth argument is for?

                        "One man's wage rise is another man's price increase." - Harold Wilson

                        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                        "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                        P Offline
                        P Offline
                        pix_programmer
                        wrote on last edited by
                        #12

                        What value has to be set to this parameter, so that my web page is opened in a smaller browser window than the normal?

                        modified on Wednesday, June 1, 2011 9:22 AM

                        D 1 Reply Last reply
                        0
                        • P pix_programmer

                          What value has to be set to this parameter, so that my web page is opened in a smaller browser window than the normal?

                          modified on Wednesday, June 1, 2011 9:22 AM

                          D Offline
                          D Offline
                          David Crow
                          wrote on last edited by
                          #13

                          There are only 12 possibilities, and some of those do not apply (e.g., SW_HIDE). In less time than it takes to read this post (and respond), you can have over half of them tested.

                          "One man's wage rise is another man's price increase." - Harold Wilson

                          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                          "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                          1 Reply Last reply
                          0
                          • P pix_programmer

                            Hi! I've to open a web page inside a Dialog(not as a popup) using ShellExecute. I've to use ShellExecute why because Navigate() function works only if IE is present in a System.Is this possible with ShellExecute? Or is there any other alternative?

                            R Offline
                            R Offline
                            rp_suman
                            wrote on last edited by
                            #14

                            If you want to open the URL in IE even if it is not set as default browser: ShellExecute(NULL,"open","iexplore.exe", csUrlToOpen, NULL, SW_SHOW); Regards

                            -- "Programming is an art that fights back!"

                            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