Как узнать Screen Saver, установленный по умолчанию?
uses
..., IniFiles, ShellAPI;
function GetLongFileName( const FileName: string ): string;
var
aInfo: TSHFileInfo;
begin
if SHGetFileInfo( PChar( FileName ), 0, aInfo, SizeOf( aInfo ), SHGFI_DISPLAYNAME ) <> 0 then
Result := string( aInfo.szDisplayName )
else
Result := FileName;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Ini: TIniFile;
ScreenSaverFile: string;
begin
Ini := TInifile.Create( 'System.ini' );
ScreenSaverFile := GetLongFileName( Ini.Readstring( 'boot', 'SCRNSAVE.EXE', '(Нет)' ) );
Ini.Free;
ShowMessage( ScreenSaverFile );
end;
|