|
-
Sep 28th, 2000, 10:44 PM
#1
Thread Starter
Lively Member
I'd like to open a html file with the system's default browser from my application. How do I detect if there's a browser installed? And how can I open that browser with specified file?
-
Sep 28th, 2000, 10:54 PM
#2
Addicted Member
Use the ShellExecute command to open a registered file type
with its associated program. If IE is associated with .htm files the command below will open the file test.htm in IE.
If Netscape is associated with .htm, then Netscape will start up.
Code:
Call ShellExecute(hwnd, "Open", "c:\temp\test.htm", "", App.Path, 1)
This will also work for other registered file types like
.doc, .txt, etc. They would open with their associated
apps like Word, Notepad, etc.
Hope this helps.
-
Sep 28th, 2000, 11:38 PM
#3
Fanatic Member
Code:
'the API was forgoten in the last post
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
Gl,
D!m
-
Oct 2nd, 2000, 05:44 PM
#4
Thread Starter
Lively 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
|