Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

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

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
Mathwiz314
Asked:
Mathwiz314
1 Solution
 
sirbountyCommented:
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
 
Mathwiz314Author Commented:
what do you mean?
0
 
sirbountyCommented:
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
Independent Software Vendors: 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!

 
Mathwiz314Author Commented:
I already did that.
It's just that it doesn't display that file in the webbrowser control
0
 
Mathwiz314Author Commented:
never mind I didn't read your comment carefully
0
 
Mathwiz314Author Commented:
I don't understand you
0
 
sirbountyCommented:
"I set my program as the default program to open a HTML file."
How did you do this?
0
 
tang_tzuchiCommented:
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
 
Mathwiz314Author Commented:
@ 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
 
sirbountyCommented:
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
 
Mathwiz314Author Commented:
yes
0
 
Mathwiz314Author Commented:
I need to display the file I'm opening in the webbrowser control
0
 
Mathwiz314Author Commented:
Where is everyone?
0
 
sirbountyCommented:
I'm not sure how to further assist here...I had hoped that someone else would chime in...
0
 
Mathwiz314Author Commented:
I'm increasing the value of this Question
0
 
sirbountyCommented:
You might try placing some pointer questions...
0
 
Mathwiz314Author Commented:
what?
0
 
Mark_FreeSoftwareCommented:

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
 
Mathwiz314Author Commented:
it knows the string but it navigates
file:///"filename"
the quotes are still there
0
 
Mathwiz314Author Commented:
never mind
i did this
strOpenFile = Mid$(strOpenFile, 2, lenFile - 2)
thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now