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. Disable the new window cration in ShellExecute?

Disable the new window cration in ShellExecute?

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorialquestion
8 Posts 6 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.
  • U Offline
    U Offline
    uresh hanmugam
    wrote on last edited by
    #1

    Hi all I have try to executing a URL using ShellExecute. Following snippet is working fine but whenever run this, a new browser window is created... ShellExecute(NULL, NULL, "http://forums.microsoft.com/MSDN/AddPost.aspx?ForumID=96&SiteID=1", NULL,NULL, SW_HIDE); How to execute a particular URL without creation of new browser window in ShellExecute? Thanks in advance surezsu

    _ D P R 4 Replies Last reply
    0
    • U uresh hanmugam

      Hi all I have try to executing a URL using ShellExecute. Following snippet is working fine but whenever run this, a new browser window is created... ShellExecute(NULL, NULL, "http://forums.microsoft.com/MSDN/AddPost.aspx?ForumID=96&SiteID=1", NULL,NULL, SW_HIDE); How to execute a particular URL without creation of new browser window in ShellExecute? Thanks in advance surezsu

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      Can you explain what do you mean by executing a URL because that would clarify your needs and help us to understand your problem better. Currently at least I don't get the point of executing a URL and hiding the window. Why to execute if you don't want to see it?

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      M 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        Can you explain what do you mean by executing a URL because that would clarify your needs and help us to understand your problem better. Currently at least I don't get the point of executing a URL and hiding the window. Why to execute if you don't want to see it?

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        well, if he already has a browser window open and he executes a "ShellExecute" in his case it will open a NEW browser window instead of just re-using the current browser window. but I'm probably wrong in my translation of the original question.

        Maximilien Lincourt Your Head A Splode - Strong Bad

        _ 1 Reply Last reply
        0
        • M Maximilien

          well, if he already has a browser window open and he executes a "ShellExecute" in his case it will open a NEW browser window instead of just re-using the current browser window. but I'm probably wrong in my translation of the original question.

          Maximilien Lincourt Your Head A Splode - Strong Bad

          _ Offline
          _ Offline
          _AnsHUMAN_
          wrote on last edited by
          #4

          OH! Now I see. So probably he should rephrase his Question. :-D That said, I now know the reason for not being able to understand his query. If IE is currently running don't open it but use the existing window to reflect the content of the URL requested Or else ...( is still in question) Hmm!!!

          Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

          D 1 Reply Last reply
          0
          • _ _AnsHUMAN_

            OH! Now I see. So probably he should rephrase his Question. :-D That said, I now know the reason for not being able to understand his query. If IE is currently running don't open it but use the existing window to reflect the content of the URL requested Or else ...( is still in question) Hmm!!!

            Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

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

            _AnShUmAn_ wrote:

            OH! Now I see. So probably he should rephrase his Question.

            Why? It made perfect sense to me.

            "Love people and use things, not love things and use people." - Unknown

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            1 Reply Last reply
            0
            • U uresh hanmugam

              Hi all I have try to executing a URL using ShellExecute. Following snippet is working fine but whenever run this, a new browser window is created... ShellExecute(NULL, NULL, "http://forums.microsoft.com/MSDN/AddPost.aspx?ForumID=96&SiteID=1", NULL,NULL, SW_HIDE); How to execute a particular URL without creation of new browser window in ShellExecute? Thanks in advance surezsu

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

              surezu wrote:

              How to execute a particular URL without creation of new browser window in ShellExecute?

              You can't. ShellExecute() is not going to search for running instances of the program associated with the third argument (i.e., the URL in your case).

              "Love people and use things, not love things and use people." - Unknown

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              1 Reply Last reply
              0
              • U uresh hanmugam

                Hi all I have try to executing a URL using ShellExecute. Following snippet is working fine but whenever run this, a new browser window is created... ShellExecute(NULL, NULL, "http://forums.microsoft.com/MSDN/AddPost.aspx?ForumID=96&SiteID=1", NULL,NULL, SW_HIDE); How to execute a particular URL without creation of new browser window in ShellExecute? Thanks in advance surezsu

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

                There is no way you can achieve this using ShellExecute. Probably, you can consider using IWebBrowser2 Interface[^].

                1 Reply Last reply
                0
                • U uresh hanmugam

                  Hi all I have try to executing a URL using ShellExecute. Following snippet is working fine but whenever run this, a new browser window is created... ShellExecute(NULL, NULL, "http://forums.microsoft.com/MSDN/AddPost.aspx?ForumID=96&SiteID=1", NULL,NULL, SW_HIDE); How to execute a particular URL without creation of new browser window in ShellExecute? Thanks in advance surezsu

                  R Offline
                  R Offline
                  Rajkumar R
                  wrote on last edited by
                  #8

                  If you really want to stick onto the shellexecute command, may be configuring the browser to force to open in same window may be useful (I won't prefer :) ) You can change the settings of internet explorer in "Internet Options" to use same window. for instance in IE7 You can change HKCU\Software\Microsoft\Internet Explorer\TabbedBrowsing -> ShortcutBehavior to 0, 1, 2. 0 is new window 1 is new tab 2 is current tab or window or disable tabbed browing and resuse same window as HKCU\Software\Microsoft\Internet Explorer\Main\AllowWindowReuse Or Automate Running Instance[^] I prefer to host in my own application using CHtmlView(MFC)

                  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