Solved

Registry?  Want to add my Prog to Win95!

Posted on 1998-06-26
4
127 Views
Last Modified: 2010-05-03
I have written an encryption/decryption program (hasn't everyone?).

I want to add it to Win95 so that when the User clicks on a file of a certain type it will bring up MY program!
It should call my Program with a command line statement saying what file the User has clicked.
 Kinda like clicking on a zip and WinZip pops up!  How do I do this?
Using VB5 Enterprise Edition
0
Comment
Question by:jgore
  • 3
4 Comments
 
LVL 4

Accepted Solution

by:
yowkee earned 200 total points
ID: 1464365
jgore,

  Basically to associate a extension(file type) with your application, you must have appropriate information in the Registry. For
example, your application name test.exe and stay in folder C:\temp, the extension to associate is .aaa. Then, in your
registry, these key must existed:
(HKCR = HKEY_CLASSES_ROOT)

----
[HKCR\.aaa]
@Defaule="aaafile"
[HKCR\aaafile\shell\open\command]
@Default="C:\temp\test.exe %1"
' And the default icon for the file with .aaa
[HKCR\aaafile\DefaultIcon]
@Default="C:\temp\test.exe,1"   (this mean first icon contain
                                 in test.exe)
Use regedit.exe to open the registry and looking for HKCR\.htm, HKCR\htmlfiles and you will feel about it.

And then, you must handle the command line arguments in your application startup code. For example,

Sub Main()

   Dim sFileToOpen As String

   sFileToOpen = Trim$(Command)
   :
   :  ' Code to handle the file..
End Sub

----

Regards.

0
 
LVL 4

Expert Comment

by:yowkee
ID: 1464366
MS has an KB article(Q185453) about this:

http://support.microsoft.com/support/kb/articles/q185/4/53.asp
0
 

Author Comment

by:jgore
ID: 1464367
OK, I checked it out and it looks good.

One question though:
I can edit my own Registry and make those changes,but I
can't ask the Users of my program to do that.
I have some VB code to edit the registry, but I hate using it.

Do you think it would work if I just copied that part of my registry and saved it
as  "test.reg" and then have user click on it? Perhaps I could even shell to it!
I've seen something like that before. Would Win95 then absorb it?
It would save a lot of code!

0
 
LVL 4

Expert Comment

by:yowkee
ID: 1464368
jgore,

  The link that I mentioned in my comment contained the code example to do this. Please let me know if you don't get it.

  By the way, if you really want to export the registry setting and save to a .reg file(eg. test.reg). You could use
  Shell("Regedit.exe test.reg",1) to import the registry file. The traditional way is using registry api to insert those registry setting and the code example existed in MS kb that I mention.

  Regards.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 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