Board index » delphi » Q: Windows 95 Registry - Reading values.

Q: Windows 95 Registry - Reading values.

I have some trouble using RegQueryValueEx. I will use it to read Windows 95
Registry values. This is what I do:

        RegOpenKeyEx(HKEY_CURRENT_USER,'Software\Author\AppName\Version',0,KEY_QUER
Y_VALUE,Key);
        RegQueryValueEx(Key,'Value',nil,aLPDWORD,Value,Size);

This doesn't work. RegQueryValueEx returns errorcode 87. Value and Size are
pointers. aLPDWORD is the type LPDWORD.

Does anyone have some experience with reading values from the registry? I
would really like some examples of how to do this.

I have no problem with creating keys and writing values to the registry. I
do the following:

        RegCreateKeyEx(HKEY_CURRENT_USER,'Software\Author\AppName\Version',0,nil,RE
G_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,nil,Key,nil);
        RegSetValueEx(Key,'Top',0,REG_DWORD,Addr(Top),SizeOf(Top));
        RegSetValueEx(Key,'Left',0,REG_DWORD,Addr(Left),SizeOf(Left));
        RegSetValueEx(Key,'Height',0,REG_DWORD,Addr(Height),SizeOf(Height));
        RegSetValueEx(Key,'Width',0,REG_DWORD,Addr(Width),SizeOf(Width));

I will use this to write information about a form to the Registry.

--
Hein Gustavsen
he...@studpors.hit.no

E-Mail please.

 

Re:Q: Windows 95 Registry - Reading values.


Forget it! I just found out that I can use the TRegistry component instead.
Therefore I would really like to know where to get some help for this
component. Delphi 2.0 help-file doesn't say much.

Hein Gustavsen
he...@studpors.hit.no

E-Mail please

Re:Q: Windows 95 Registry - Reading values.


In article <01bbc852$6bf03b40$3396d...@heing.online.no>, "Hein Gustavsen" <he...@studpors.hit.no> wrote:

Quote
>Forget it! I just found out that I can use the TRegistry component instead.
>Therefore I would really like to know where to get some help for this
>component. Delphi 2.0 help-file doesn't say much.

There is a great help file on the Delphi Super Page. Check that one out.

R.E. den Braasem (aka The Graphical Gnome)
(r...@ktibv.nl)

Senior Software Engineer

Re:Q: Windows 95 Registry - Reading values.


I've never had any luck with the Registry components, but I wrote
my own regfun.pas unit of registsy functions. It has the usual
get/set functions and a few goodies like a function to set
the default value, and a function to populate two TStringLists
with the subkey/value pairs of a key. If people need this,
I can clean it up and post it...

Scott

Other Threads