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. IE8 and ShellExecute weirdness

IE8 and ShellExecute weirdness

Scheduled Pinned Locked Moved C / C++ / MFC
c++com
4 Posts 3 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
    Monty2
    wrote on last edited by
    #1

    Hi, i am using ShellExecute to launch a url in the default browser, the same code has been working for a few years now. all of a sudden one guy is complaining that URLs are not working on his 3 PCs what happens is ShellExecute is called and "If IE8 is running it opens up the site fine but if no IE8 instance is running a new instance comes up, tries to load the page and just keeps loading and nothing happens" this is very weird cause its tha same old boilerplate code for ShellExecute Here is the code

    HINSTANCE ret = ShellExecute(NULL, "open", "http://www.google.com", NULL, NULL, SW_SHOWNORMAL);

    any ideas are more welcome thanks for your time


    C++ where friends have access to your private members !

    L 1 Reply Last reply
    0
    • M Monty2

      Hi, i am using ShellExecute to launch a url in the default browser, the same code has been working for a few years now. all of a sudden one guy is complaining that URLs are not working on his 3 PCs what happens is ShellExecute is called and "If IE8 is running it opens up the site fine but if no IE8 instance is running a new instance comes up, tries to load the page and just keeps loading and nothing happens" this is very weird cause its tha same old boilerplate code for ShellExecute Here is the code

      HINSTANCE ret = ShellExecute(NULL, "open", "http://www.google.com", NULL, NULL, SW_SHOWNORMAL);

      any ideas are more welcome thanks for your time


      C++ where friends have access to your private members !

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I think your call to ShellExecute has a problem. The third parameter should be the name of the .exe, and the fourth should be the command line parameter; in this case, the URL. What happens if you try this? (It works for me) -

      ShellExecute(NULL, \_T("open"), \_T("iexplore.exe"), \_T("http://www.google.com"), NULL, SW\_SHOWNORMAL);
      

      L u n a t i c F r i n g e

      L 1 Reply Last reply
      0
      • L Lost User

        I think your call to ShellExecute has a problem. The third parameter should be the name of the .exe, and the fourth should be the command line parameter; in this case, the URL. What happens if you try this? (It works for me) -

        ShellExecute(NULL, \_T("open"), \_T("iexplore.exe"), \_T("http://www.google.com"), NULL, SW\_SHOWNORMAL);
        

        L u n a t i c F r i n g e

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        That is not what I would expect. Your code is enforcing Internet Explorer as the browser to open a particular URL; putting the URL (or any filename with a file extension association) as the third parameter should call the associated EXE to open that URL/file, similar to a double-click inside Windows Explorer. I suggest you try with a .doc file. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        Getting an article published on CodeProject should be easier and faster for Bronze and Silver authors.


        L 1 Reply Last reply
        0
        • L Luc Pattyn

          That is not what I would expect. Your code is enforcing Internet Explorer as the browser to open a particular URL; putting the URL (or any filename with a file extension association) as the third parameter should call the associated EXE to open that URL/file, similar to a double-click inside Windows Explorer. I suggest you try with a .doc file. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


          Getting an article published on CodeProject should be easier and faster for Bronze and Silver authors.


          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Luc Pattyn wrote:

          Your code is enforcing Internet Explorer as the browser

          Hadn't thought of that... MS slave that I am. I was thinking IE, not generic browser. ;)

          L u n a t i c F r i n g e

          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