RE: Can't delete Registry key

Angus Macdonald <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <8281693F9EF2B140AA145EE9BE4675A60418383A@nwwmail1.nww-tr.wales.nhs.uk>
What permissions are set on the registry key? XP will enforce them.

-----Original Message-----
From: mikidavme [mailto:[email protected]]
Sent: 18 July 2003 13:50
To: [email protected]
Subject: [Delphi] Can't delete Registry key


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	

ADVERTISEMENT
 
<http://rd.yahoo.com/M=244522.3512152.4794593.1261774/D=egroupweb/S=17051153
62:HM/A=1595055/R=0/SIG=1247d4o3g/*http://ashnin.com/clk/muryutaitakenattogy
o?YH=3512152&yhad=1595055> Click Here!	
 
<http://us.adserver.yahoo.com/l?M=244522.3512152.4794593.1261774/D=egroupmai
l/S=:HM/A=1595055/rand=702565437> 	

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

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> . 




[Non-text portions of this message have been removed]


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/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.