Solved

Registry?  Want to add my Prog to Win95!

Posted on 1998-06-26
4
129 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

816 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

8 Experts available now in Live!

Get 1:1 Help Now