phone_fun_4me
asked on
visual basic 6.0- click button to launch a new web page
Hi, in visual basic I made a program (.exe file) that stores all of my most commonly used applications / web pages. So I click a button, and it launches the appropriate thing, for example button 1 launches microsoft word, button 2 launches microsoft excel...........button 11 launches paypal, etc.
To launch the programs / websites, I use this script: (for ex. this would launch paypals website)-
ShellExecute Me.hwnd, "Open", "http://www.paypal.com/", vbNullString, "C:\", SW_SHOWNORMAL
The only thing that gets annoying is if I have another web page open but minimized for example, instead of launching a new IE browser page, it loads on on the page that was minimized. If I dont have any web pages open then this script works perfectly- because it launches a new page.
How can I get it to launch a new webpage even if I have one thats already minimized?
To launch the programs / websites, I use this script: (for ex. this would launch paypals website)-
ShellExecute Me.hwnd, "Open", "http://www.paypal.com/", vbNullString, "C:\", SW_SHOWNORMAL
The only thing that gets annoying is if I have another web page open but minimized for example, instead of launching a new IE browser page, it loads on on the page that was minimized. If I dont have any web pages open then this script works perfectly- because it launches a new page.
How can I get it to launch a new webpage even if I have one thats already minimized?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
FYI...
what I was talking about was opening the windows registry and extracting data from the registry which shoudl provide the .exe file of the default browser...
from that, you can use the ShellExecute command (which is just like opening a windows command shell and running a command) to execute the .EXE of the default browser..
The additional part is, lots of executable take "command line" arguments which override default args..
so the idea is to scan the registry to get the default web exe, i.e. iexplore.exe
then to fire off ShellExecute in a way that passes arguments to iexplore.exe
here's some people trying to do the same thing:
http://blogs.msdn.com/petel/archive/2007/01/19/internet-explorer-7-command-line-arguments.aspx
what I was talking about was opening the windows registry and extracting data from the registry which shoudl provide the .exe file of the default browser...
from that, you can use the ShellExecute command (which is just like opening a windows command shell and running a command) to execute the .EXE of the default browser..
The additional part is, lots of executable take "command line" arguments which override default args..
so the idea is to scan the registry to get the default web exe, i.e. iexplore.exe
then to fire off ShellExecute in a way that passes arguments to iexplore.exe
here's some people trying to do the same thing:
http://blogs.msdn.com/petel/archive/2007/01/19/internet-explorer-7-command-line-arguments.aspx
ASKER
idle mind- works perfect!
jrocnuck- you lost me but thanks for the offer