28
Jul 08

Delphi: Utils :: ChangeDropShadow

:: articles :: by Gilberto Saraiva

Folks,

With this procedure you can change the Drop Shadow effect provided by windows XP/Vista on all windows without need to reset the computer.

 Delphi |  copy code |? 
01
procedure ChangeDropShadow(AActive: boolean);
02
var
03
  Buff: Cardinal;
04
  Param: Pointer;
05
  DevMode: TDeviceMode;
06
begin
07
  with TRegistry.Create do
08
  begin
09
    RootKey := HKEY_CURRENT_USER;
10
    if OpenKey('\Control Panel\Desktop\', false) then
11
    begin
12
      ReadBinaryData('UserPreferencesMask', Buff, 4);
13
      if AActive then
14
        Buff := Buff or (1 shl 18)
15
      else
16
        Buff := Buff xor (Buff and (1 shl 18));
17
      WriteBinaryData('UserPreferencesMask', Buff, 4);
18
      Param := nil;
19
      if AActive then
20
        Param := @AActive;
21
 
22
      SystemParametersInfo(SPI_SETDROPSHADOW, 0,
23
        Param, SPIF_SENDWININICHANGE);
24
    end;
25
    Free;
26
  end;
27
end;

Hugs!

Tags: , , , , , ,


Leave a comment