Solved

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

Posted on 2007-03-24
20
203 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
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now