Solved

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

Posted on 2007-03-24
20
227 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
In this post we will learn different types of Android Layout and some basics of an Android App.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

707 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