Link to home
Start Free TrialLog in
Avatar of dms@
dms@

asked on

Is there a way to re-load the registry while running Windows ?

Is there a way to re-load the registry in Windows so that Windows system settings take effect ?
Avatar of anilms
anilms

Yes, if you are using Windows NT, you use the regedt32 command instead of regedit command. This allows you to save and restore the registry directly when running Windows NT
Avatar of dms@

ASKER

It's for Windows 95
I think so you are searching for :

SendMessage( hwnd_broadcast,  WM_WININICHANGE );
sorry .

Windows 95: The WM_WININICHANGE message is implemented on the Windows NT platform, but not on the Windows 95 platform. Windows 95 applications should use the WM_SETTINGCHANGE message, which provides equivalent functionality.

good work !
Hi
Are you there ?

ASKER CERTIFIED SOLUTION
Avatar of mirek071497
mirek071497

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dms@

ASKER

Well, it still doesn't seem to work. Windows refreshes the desktop allright, but it doesn't reload the icons !
Why you don't say that you need reload icons !
I will try this today and if I found solution (or not) I submit comment tomorrow or today afternoon.
Avatar of dms@

ASKER

Well, the basic idea is that I change the location of the Desktop
(default C:\WINDOWS\DESKTOP) in the registry and after this, Windows will have to show the icons of the new directory.
Avatar of dms@

ASKER

Adjusted points to 220
Yes. This is big problem. I found so probably the only one way to reload icons from HDD is to change icon size from 32 to other and then back to 32. You can test this in properties for screen. I have Polish version so i can't say right names but in the third tab you can find combobox where the icon is listed. You can change then the icon size and apply changes. However you must remember to set this value back ! I don't know now how to do this in delphi, but when I found this then I submit comment.
Hi

Mayby this is not very fine however this is working solution.

uses
  Registry;

procedure TForm1.Button1Click(Sender: TObject);
var
  reg : TRegistry;
  st  : string;
begin
  reg := TRegistry.Create;
  if reg.OpenKey('Control Panel\desktop\WindowMetrics', false) then
    begin
      st := reg.readstring('Shell Icon Size');
      reg.writestring( 'Shell Icon Size', IntToStr(StrToInt(st)+1) );
      SendMessage( hwnd_broadcast, WM_SETTINGCHANGE, 0, 0 );
      reg.writestring( 'Shell Icon Size', st );
    end;
  reg.free;
end;