Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 11-06-2009, 02:12 AM
Gurt Gurt is offline
Junior Member
 
Join Date: Jan 2003
Posts: 22
Unhappy writing to registry in Windows 7

I have the following script that works fine in earlier versions of Windows:

Code:
var
Reg: TRegistry;
begin
Reg:= TRegistry.Create;

Reg.RootKey:= HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\', True) then
begin
Reg.WriteString('NoDesktop', '1');
Reg.CloseKey;
end;
Reg.Free;
end;
The end result should be HKEY_CURRENT_USER\\Software\Microsoft\Windows\Curr entVersion\Policies\Explorer with a new string being NoDesktop with a value of 1

I have noticed that the key keeps getting written to HKEY_USERS

Again, it works fine in older versions of Windows.

I know Windows 7 has significant changes in its permissions to the registry and file system.

From everything I have read, writing to HKEY_CURRENT_USER should be fine.

Any idea how I can get that key properly written to the registry?

Thanks,
Garrett
Reply With Quote
  #2  
Old 11-06-2009, 03:02 AM
Gurt Gurt is offline
Junior Member
 
Join Date: Jan 2003
Posts: 22
Default Update

I discovered that I can write to the registery under...

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\

but not under...
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\

Another Windows 7 delight.

Any ideas?

The ultimate goal is to programmatically disable the desktop icons and desktop right-click while running my application and then restoring it when my application exits.

This is a key feature for my program and not implementing it is not an option.

I used DWinLock for previous version of Windows, but it doesn't work for disabling the desktop in Windows 7. I believe this is due to the what used to be "Progman" handle being changed (on each reboot) with 7.

Thanks
Reply With Quote
Reply

Tags
hkey_current_user, hkey_users, registry, windows 7

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 04:40 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.