?
Solved

EASY POINTS!!!!!!!!!!! OPEN Start up HTMLfile in VB

Posted on 2007-03-24
20
Medium Priority
?
234 Views
Last Modified: 2010-04-06
HI
I'm using VB 6 to program a browser.
I set my program as the default program to open a HTML file.
When I clicked the HTML file, it opened my program, but doesn't show the file in the webbrowser control.
Is there any way to open the file by clicking it on my desktop?

Thanks
0
Comment
Question by:Mathwiz314
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
20 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18785670
How did you set it up?
Usually there's a reference like
appname.exe "%1"
to denote to open the target with your app...
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18786676
what do you mean?
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18786711
Well, usually when you set a file type to open with a specific app, the registry is updated to reflect this...
For instance, if you check your HKCR\txtfile\shell\open\command
you'll find a value there to determine that notepad opens %1 - the parameter passed to it (i.e, the file name):

%SystemRoot%\system32\NOTEPAD.EXE %1

Check your extension under that hive...
0
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 1

Author Comment

by:Mathwiz314
ID: 18789586
I already did that.
It's just that it doesn't display that file in the webbrowser control
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18790036
never mind I didn't read your comment carefully
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18790045
I don't understand you
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18790477
"I set my program as the default program to open a HTML file."
How did you do this?
0
 
LVL 3

Expert Comment

by:tang_tzuchi
ID: 18790619
hi, please correct me if im wrong.... you want to open your program from the desktop like clicking on the icon right? then you can export your program to exe. in vb 6 there is a command to export the program to exe format.
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18796932
@ tang tzuchi
no, I want open an html file by clicking the icon

@sirbounty
I right clicked to html icon and clicked "open with ..." > "choose program"
then I browsed for my program exe ,
next I checked "Alway use  the selected program ..."
and clicked ok
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18796944
Okay, so if you search for you program in the registry, you should find the reference in the HKey_Classes_Root hive path that I mentioned before...
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18797198
yes
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18797210
I need to display the file I'm opening in the webbrowser control
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18833505
Where is everyone?
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18833931
I'm not sure how to further assist here...I had hoped that someone else would chime in...
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18902165
I'm increasing the value of this Question
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18902210
You might try placing some pointer questions...
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18911433
what?
0
 
LVL 13

Accepted Solution

by:
Mark_FreeSoftware earned 1000 total points
ID: 18968801

okay, when your program starts, you are loading a form?

let's call that form1

now place this code in form1:


Private sub Form_Load()
   dim str as string
   str = Command$
   if len(trim(str)) <> 0 then
      'place here your code to navigate to the url,
       ' it is stored in str
       'could be something like Webbrowser1.navigate str
   end if
end sub

what you are doing here:
reading the commandline (Command$) and place it in the string str
check if str is not empty (the program was started by clicking on a file!)
and then you have to fill in your own code to do somthing with the url you just obtained
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18981009
it knows the string but it navigates
file:///"filename"
the quotes are still there
0
 
LVL 1

Author Comment

by:Mathwiz314
ID: 18981189
never mind
i did this
strOpenFile = Mid$(strOpenFile, 2, lenFile - 2)
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question