Can't delete Registry key

"mikidavme" <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
I have been attempting to get a program to find certain keys in the 
registry and delete them.  I have very little experience of Registry 
programming, and I must have misunderstood something, because I 
cannot manage to do this.

I am using Delphi 7 on Windows XP.

I have a TRegistry object called Reg, and, in an attempt to track 
down my error, I have produced the following debugging version of my 
deletion code:

if Reg.OpenKey(SKey,False)
then
  begin
    if Reg.DeleteKey(SKey)
    then Memo9.Lines.Add('Key deleted')
    else Memo9.Lines.Add('Not deleted');
  end

The text 'Not deleted' is added.  Clearly the key was successfully 
opened, but not deleted.  I have searched in the Delphi Help and 
can't find any clue.  The example given in Delphi Help to illustrate 
DeleteKey uses:
  Reg.OpenKey(Edit1.Text,False)
followed by:
  Reg.DeleteKey(Edit1.Text),
which is essentially the same as what I am doing.

Any help?

 Michael Davis


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Natural Vitamins for Good Prostate & Male Health. $28.97
http://www.challengerone.com/t/l.asp?cid=2865&lp=prosta2.html
http://us.click.yahoo.com/qJIe0D/89VGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.