CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2001
    Location
    Oregon, USA
    Posts
    12

    ShellExecute to load new instance of IEXPLORE.EXE

    among other things i am trying, this one is fairly simple i just cant get it to execute properly. I want a new instance of internet explorer to load and display a page which i have specified. i can get this to work at the cmd line with this "start iexplore.exe http://chat.msn.com/find.msnw?cat=CP" but when i try to do that within VB it doesnt seem to work. i have also thrown a variable into the mix by letting the user have input into which category it displays (msn sorts the chat room categories by 2 letters... such at CP for computing or TN for teen). the code that i have so far is as follows:


    private Sub cmdViewPage_Click()
    ShellExecute hWnd, "open", "http://chat.msn.com/find.msnw?cat=" & txtCategory.Text, vbNullString, vbNullString, conSwNormal
    End Sub



    the only problem with this is that it doesnt open a new instance of IE.. it uses one thats already open, and to open a new instance i need this cmd to execute: "start iexplore.exe http://chat.msn.com/find.msnw?cat=CP"
    i cant seem to get it to work within VB, so if anyone has any suggestions i would really appriciate it. thx,

    -frank


  2. #2
    Join Date
    Apr 2000
    Posts
    69

    Re: ShellExecute to load new instance of IEXPLORE.EXE

    Try visit to www.vbcode.com and search for 'shell' a lot of sample code for execute an IE.

    Eddie


  3. #3
    Join Date
    May 2001
    Location
    MO, USA
    Posts
    87

    Re: ShellExecute to load new instance of IEXPLORE.EXE

    try this

    shell "c:\program files\inernet explorer\iexplorer.exe http://www.yourdomain.com"


    works for me

    midnightservice



  4. #4
    Join Date
    Jun 2001
    Location
    Virginia, United States
    Posts
    16

    Re: ShellExecute to load new instance of IEXPLORE.EXE

    It has been a while since I programmed in VB, so this may not work. In the command line, if you type "start mypage.htm" the system will open a new instance of IE displaying the page you gave it. I think if you change "open" to "start" in you ShellExecute command that will handle it. Let me know if it works.

    Zac Howland

  5. #5
    Join Date
    Sep 2001
    Location
    Oregon, USA
    Posts
    12

    Re: ShellExecute to load new instance of IEXPLORE.EXE

    alright i finally got this to work, thanks everyone


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured