Hello,
Im quite a beginner and i was wondering if there was ANY code for VB6 that would allow me to open an Internet Explorer Window when my user presses the Help Button.
ANY help would be excellent
Darcey :thumb:
Printable View
Hello,
Im quite a beginner and i was wondering if there was ANY code for VB6 that would allow me to open an Internet Explorer Window when my user presses the Help Button.
ANY help would be excellent
Darcey :thumb:
Moved From The CodeBank.
Welcome to the Forums darcey_123. :wave:
Actually, there are a wide variety of ways to open an IE Window. Here is one, and I'm sure other members will post other ways.VB Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _ ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) As Long Private Sub cmdHelp_Click() Dim lngOpenPage As Long lngOpenPage = ShellExecute(Form1.hwnd, "Open", "http://www.vbforums.com", 0&, 0&, 0&) End Sub
Hey Hack
Thanks for your reply....however i think it needs some explaining... :sick:
Form1.hwnd <-----wats this? do i need to change to a specific form?
and also when i go to run it i get an error sayin that a comment can only be put after end sub, end property......
the code you gave me isnt a comment so wat is it on about it?? :ehh:
Neway Thank You soo much for help and i a cant wait to here ur reply :D
Darcey
Thats what can be called the reference number to a Window. Its the thing that Windows uses to keep track of all its windows :)Quote:
Originally Posted by darcey_123
These are called handels and are used by many API functions and Windows its-self internelly :)
API Declerations normally go at the top of the form, did you put them at the top?Quote:
Originally Posted by darcey_123
Cheers,
RyanJ
First, the API declaration needs to go in the General Declarations section of your form.
Do you know what I mean by the General Declarations section?
Form1 is an example. You have a form in your project now. I don't know what it is called, but change Form1 in my example to your forms name, so that parameter would read: frmYourFormsName.hwnd
(PS: The hwnd property contains the handle of your form which the ShellExecute API requires in order to perform the requested task.)
Hey Guys,
THANK U SOOO MUCH..you have made my assignment alot easier.....god i cant thankyou enuf. :bigyello: :bigyello: :bigyello:
Thank you again Darcey :wave: