internet

This is a discussion on internet within the C Programming forums, part of the General Programming Boards category; Hey, can you make it so that it will open ie or mozilla to a site? can you open them ...

  1. #1
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21

    Smile internet

    Hey,

    can you make it so that it will open ie or mozilla to a site?
    can you open them at all?

    Thanks,
    Yeah

  2. #2
    ---
    Join Date
    May 2004
    Posts
    1,379
    Code:
    include <stdlib.h>
    
    int main(void){
        system("mozilla.exe");
        return 0;
    }

  3. #3
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21
    what about to a site that want them to go to?
    not their home!

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379
    I think something like that would be more OS dependant. Some body else could probably shed more light on this than I could.

  5. #5
    Registered User
    Join Date
    Jul 2004
    Posts
    68
    I know Firefox accepts an argument as the url to go to so

    Code:
    system("/path/to/firefox http://yourdomain.com");
    Could work.

  6. #6
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21
    ok, thanks!

    i have another though!!!

    what about choosing the default browser, not just firefox or ie, but it looks for the default
    is it possible?

    thanks,
    Yeah

  7. #7
    Registered User xxxrugby's Avatar
    Join Date
    Jan 2005
    Posts
    178
    Yes you could but I think that you should look into registry on Windows for that.
    And that get value from registry and then execute that with System().
    Maybe there is another way! But I dont now C so good that I could write a code for you how to get registry!

    For the Win code you could look this thread !

    And for pages on msdn look this thread!
    Last edited by xxxrugby; 02-10-2005 at 12:05 PM.
    Sorry for spelling errors, not English!
    xxxrugby: "All Human Race Will Die From My Hand!"
    xxxrugby: "We are all philosophers, when question is about politics!"

  8. #8
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,672
    ShellExecute?
    I used to be an adventurer like you... then I took an arrow to the knee.

  9. #9
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Are you trying to open a specific website? If you know the website you want to open just create a shortcut to it and then have your program open the shortcut. When you do this the OS will take over and load it in the default browser.
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  10. #10
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21
    still,

    how do you make it open the default browser.
    maybe its an if statement!!

  11. #11
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    By opening the shortcut it will open it in the default browser, aka just open the shortcut.
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  12. #12
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21
    really?
    i guess so!

    thanks

  13. #13
    Mad OnionKnight's Avatar
    Join Date
    Jan 2005
    Location
    Umeå, Sweden
    Posts
    555
    I know that if you use Run (Win+r, or startmenu) and type in an address like http://www.google.com it will open it in the default browser. I tested around some and found that "start" is like Run so...

    Code:
    system("start http://www.google.com");
    Of course, replace google with whatever you want.
    Last edited by OnionKnight; 02-12-2005 at 07:49 AM. Reason: Forgot code tag

  14. #14
    Registered User
    Join Date
    Sep 2004
    Posts
    8
    While system() is a nice function and all, you would probably be better off with ShellExecute.

    This will open Google in the default browser:

    Code:
    ShellExecute(NULL, _T("open"), _T("http://google.com"), NULL, NULL, SW_SHOWNORMAL);

  15. #15
    Blaher yeah's Avatar
    Join Date
    Feb 2005
    Posts
    21
    what does all that NULL stuff mean?
    i know that null means "nothing" or no info!

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

Similar Threads

  1. 2 internet connections
    By Erakis in forum Windows Programming
    Replies: 0
    Last Post: 07-01-2009, 07:14 AM
  2. Internet Problems
    By SirCrono6 in forum Tech Board
    Replies: 3
    Last Post: 04-26-2004, 09:47 PM
  3. XP Internet problems
    By Hunter2 in forum Tech Board
    Replies: 9
    Last Post: 09-18-2003, 08:56 PM
  4. Internet Publishing Laws
    By novacain in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-09-2002, 01:19 PM

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