Internet Window???

This is a discussion on Internet Window??? within the C++ Programming forums, part of the General Programming Boards category; Call ShellExecute() like people said. Or you could try this solution I saw somewhere before: Execute rundll32 with the following ...

  1. #16
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Call ShellExecute() like people said.

    Or you could try this solution I saw somewhere before:

    Execute rundll32 with the following args:

    • "url.dll"
    • "FileProtocolHandler"
    • Whatever your link is

  2. #17
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    907
    Code:
    ShellExecute(current_hwnd, "open", "http://www.booyah.com", NULL, NULL, SW_SHOWNORMAL);
    Something like that. That's not anything complicated.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  3. #18
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    The reason that you can't execute iexplore with just iexplore is that the shell can't find iexplore. iexplore needs to be in the path (which is rare) or else you need to pass the full path to it, like "\Program Files\Internet Explorer\iexplorer.exe".

    But, of course, the easier way to do it is to use ShellExecute(). You can pass ShellExecute() a file, and it will run the program that you have set to open that type of file by default, just as if you'd double-clicked on the file in explorer.

    Note that you'll have to include <windows.h> to use ShellExecute(): ShellExecute() is a Windows-only function and thus by using it you sacrifice some portability.

    [edit] On the other hand, explorer.exe is almost always in the path, so if you want to open a folder for the user to view, you can just call
    Code:
    system("explorer.exe .");
    (. is the current directory.)[/edit]
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #19
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    I wont work can someone post a solution

  5. #20
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    >> I wont work can someone post a solution
    Several solutions have been posted, including one that several people agree is probably best. If you are having trouble implementing that solution, feel free to explain what is not working and maybe we can help you get it working.

  6. #21
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Quote Originally Posted by MaGaIn View Post
    I wont work can someone post a solution
    I'm assuming it was a typo to say "I" instead of "It", but it seems to fit anyway.

    Don't be so freaking lazy. Even the way you tell us you have trouble is an example of laziness. For those of us that take the time to try to help you, couldn't you do us the favor of telling us what isn't working? Tell us what you tried, what you expected it to do, and what actually happened.

    Try to learn how to learn. That's what good programmers must conquer. If you get a job as a programmer, and you're using some software written by some other company, and you're having trouble figuring it out, do you think their tech support wants to hear you say, "It won't work."? I think not.

    Try again.

  7. #22
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    My response was posted much later than I had sent it. I was unaware of the shell execute post when I made my post. I feel that your personal attacks are uncalled for.

  8. #23
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    I am getting this error with this line

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

    error C2065: 'current_hwnd' : undeclared identifier

  9. #24
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    >> I was unaware of the shell execute post when I made my post.
    ShellExecute was actually suggested twice a full 24 hours earlier.

    Unfortunately there is a little more to it than what was in CodeMonkey's example. Use the example in the FAQ, it is more complete and has comments describing a little bit of what it is doing.

    BTW, the FAQ I'm referring to is the link in the bar at the top of the page that says FAQ (not the FAQ board if that is where you were looking).

  10. #25
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Quote Originally Posted by MaGaIn View Post
    My response was posted much later than I had sent it. I was unaware of the shell execute post when I made my post. I feel that your personal attacks are uncalled for.
    Your laziness is uncalled for. How about a "thank you" to the people that gave you the solution over and over again that somehow you didn't read?

  11. #26
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    I guess six(6) Thank Yous (Im sorry that some of them are "Thanks") are not enought.

  12. #27
    Registered User
    Join Date
    Jul 2007
    Posts
    75
    enough

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 09:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 11:50 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21