?
Solved

Registry?  Want to add my Prog to Win95!

Posted on 1998-06-26
4
Medium Priority
?
133 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
[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
  • 3
4 Comments
 
LVL 4

Accepted Solution

by:
yowkee earned 800 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Suggested Courses

741 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