Solved

how to open regedit and show key

Posted on 2000-04-09
6
342 Views
Last Modified: 2010-04-04
  How can I open regedit.exe and have it show a key from my program?  I can open regedit.exe by simply running it, but I also want it to show a certain key, for example, HKEY_CLASSES_ROOT\.bat.
   I assume that there must be parameters that can be passed with regedit.exe to do this, but I have experimented with different switches and have found nothing that works.
   Fix-It Utilities 2000 by Ontrack does this and I have heard that other programs also do this, so it can be done.
   How?
0
Comment
Question by:RayGeide
6 Comments
 
LVL 1

Expert Comment

by:new_x
ID: 2699026
I do not know how to supply arguments to regedit.exe. But instead of running regedit.exe and showing key info, you can show this info within your program by using registry functions without need to run regedit.exe

Regards,
0
 

Author Comment

by:RayGeide
ID: 2699045
Yes, I am well aware of that.
I am writing a program that will work with the registry and a user has asked that I provide with it the ability to open regedit so that the user can see where the key is and what is in it, before deleting it.  He mentioned that the program that he is using opens regedit and shows the key.  I have Fix-It Utilities and it also does this.  I want to be able to do this in my program.
0
 
LVL 2

Expert Comment

by:Serega
ID: 2699294
All known regedit command line options:
regedit.exe [options] [filename]
filename      Import .reg file into the registry    
/s            Don't display dialog box when importing .reg files
/e            Export registry file
              e.g. regedit /e filename.reg HKEY_LOCAL_MACHINE\SYSTEM
/L:system     Specify the location of the system.dat to use
/R:user       Specify the location of the user.dat to use
/C            Compress [filename] (Windows 98)

I think, Fix-It Utilities 2000 install their own regedit utility, that look like windows regedit (most probably instead of it) and then start it with specific parameters. You can find links to alternative regedits at www.regedit.com.
0
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!

 
LVL 17

Accepted Solution

by:
inthe earned 100 total points
ID: 2701115
"regmon" from http://www.sysinternals.com
can do this without using extra parameters or installing its own regedit ..
the source code for regmon is available at same site.
(unfortunatly it was wrote in c )
0
 
LVL 1

Expert Comment

by:nrico
ID: 2703271
There are some magic things in Windoze that are called DDE and OLE. I can't even begin to think or understand what they mean, but it comes down to the principle that any program can call, start, give orderds and share information with another program that supports this.

So I guess that must be what your Fix-It does. Sorry I can't say anyting constructive though.
0
 

Author Comment

by:RayGeide
ID: 2706728
  I knew about the commandline options and I had already determined that Fix-It was actually running regedit.exe and not just immitating it.
   I took a look at regmon which does the same thing as Fix-It (just slower).  So I looked at the source code and saw that it was indeed running regedit.exe, setting the focus to it, and entering keystrokes to get to the proper key.  I rewrote the C code to Delphi and after some more fiddling was able to do it.  Thanks inthe for pointing me in the right direction.
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
How to call a form that is in a DLL  from an application? 13 86
Run video youtube webbrowse 10 73
Delphi Yen format 3 58
JAudiorecorder record freezing the app 29 82
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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