|
-
May 20th, 2000, 02:15 AM
#2
Fanatic Member
Can't think of any way to actually put the Hyperlink in the messagebox, but you can either build your own form or have the browser start when the user clicks OK on the messagebox.
Code is as follows:
Dim FileName As String, Dummy As String
Dim BrowserExec As String * 255
Dim RetVal As Long
Dim FileNumber As Integer
Const SW_SHOWNORMAL = 1
Sub Link_Click()
BrowserExec = Space(255)
FileName = App.Path & "\temphtm.HTM"
FileNumber = FreeFile() ' Get unused file number
Open FileName For Output As #FileNumber ' Create temp HTML file
Write #FileNumber, " <\HTML>" ' Output text
Close #FileNumber ' Close file
' Then find the application associated with it.
RetVal = FindExecutable(FileName, Dummy, BrowserExec)
BrowserExec = Trim$(BrowserExec)
' If an application is found, launch it!
If RetVal <= 32 Or IsEmpty(BrowserExec) Then ' Error
MsgBox "Could not find browser.", vbCritical, "HyperPad"
Else
RetVal = ShellExecute(MDIForm1.hwnd, "open", BrowserExec, "www.realisticgraphics.com", Dummy, SW_SHOWNORMAL)
If RetVal <= 32 Then
MsgBox "Webpage could not be opened.", vbCritical, "HyperPad"
End If
End If
Kill FileName
End Sub
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
|