Opening a web page
Let''s say I want to create a program with a single push-button. When that button is pressed, I want to open up a link to a website. Can someone give me the code for it? I''m trying to make an ActiveX control, so Visual Basic codes are welcome.
Thanks
You should be able to use a call the ShellExecute or ShellExecuteEx, passing the address of the site or file as an argument.
Look my site for an example on how to do this, http://members.aol.com/dragoninet has more on this
Tim
--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim
--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
Hmmm, is there a way to set the referer? so you can see where you came from? I hope you understand what I meen...
Use ShellExecute...
ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
You use "open" for lpOperation and the string for the link to open in lpFile... Everything else is NULL exept nShowCmd : SW_SHOWNORMAL. Just hope it''ll help a little bit.
ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
You use "open" for lpOperation and the string for the link to open in lpFile... Everything else is NULL exept nShowCmd : SW_SHOWNORMAL. Just hope it''ll help a little bit.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement