Aqui pongo el codigo final que he dejado en mi programa (comentarios traducidos al español), y funciona bastante bien hasta el momento:
Código Delphi
[-]...
var
DropShadowEnabled: Boolean; ...
function IsWinXP: Boolean;
begin
Result:=(Win32Platform = VER_PLATFORM_WIN32_NT) and
(Win32MajorVersion >= 5) and (Win32MinorVersion >= 1);
end;
function isDropShadowEnabled: Boolean;
begin
SystemParametersInfo(SPI_GETDROPSHADOW, 0, @Result, 0);
end;
procedure TMainForm.doActivateDropShadow;
var
teniaSombra: Boolean;
begin
teniaSombra:=isDropShadowEnabled;
if DropShadowEnabled then
begin
SystemParametersInfo(SPI_SETDROPSHADOW, 0, Pointer(True), 0);
SetClassLong(Handle,GCL_STYLE, GetClassLong(Handle, GCL_STYLE) or CS_DROPSHADOW);
end
else SystemParametersInfo(SPI_SETDROPSHADOW, 0, Pointer(False), 0);
RecreateWnd;
SystemParametersInfo(SPI_SETDROPSHADOW, 0, Pointer(teniaSombra), 0);
end;
Saludos.