Re: Can't delete Registry key
"Felipe Rezek Mohallem" <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <[email protected]> |
Hi, Michael. In windows XP, NT and 2K, if u want to delete a key, u have to delete all sub-keys before deleting it. So, subkeys must be explicitly deleted by separate calls to DeleteKey. Best reggards, Felipe ----- Original Message ----- From: mikidavme To: [email protected] Sent: Friday, July 18, 2003 9:50 AM 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 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 the Yahoo! Terms of Service. [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/