[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Registry?  Want to add my Prog to Win95!

Posted on 1998-06-26
4
Medium Priority
?
134 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

Industry Leaders: 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!

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

656 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