Solved

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

Posted on 2007-03-24
20
197 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add mobile access to browser application 3 133
scoreUp challenge 14 48
Fibonacci challenge 11 84
Making an alias 7 54
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
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.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

747 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

9 Experts available now in Live!

Get 1:1 Help Now