|
-
Jun 3rd, 2005, 05:58 AM
#1
Thread Starter
Member
School Assignment - Open IE {resovled}
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
Last edited by darcey_123; Jun 13th, 2005 at 10:02 PM.
-
Jun 3rd, 2005, 06:02 AM
#2
Re: School Assignment - Open IE
Moved From The CodeBank.
Welcome to the Forums darcey_123.
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
-
Jun 3rd, 2005, 06:17 AM
#3
Thread Starter
Member
-
Jun 3rd, 2005, 06:20 AM
#4
Re: School Assignment - Open IE
 Originally Posted by darcey_123
Hey Hack
Thanks for your reply....however i think it needs some explaining...
Form1.hwnd <-----wats this? do i need to change to a specific form?
Thats what can be called the reference number to a Window. Its the thing that Windows uses to keep track of all its windows 
These are called handels and are used by many API functions and Windows its-self internelly 
 Originally Posted by darcey_123
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??
Neway Thank You soo much for help and i a cant wait to here ur reply
Darcey
API Declerations normally go at the top of the form, did you put them at the top?
Cheers,
RyanJ
-
Jun 3rd, 2005, 06:20 AM
#5
Re: School Assignment - Open IE
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.)
-
Jun 3rd, 2005, 06:51 PM
#6
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|