Приветствую Вас Гость | RSS

Меню сайта

Реклама

Категории раздела
CD-ROM [11]
DLL и PlugIns [75]
Help файлы [20]
INI файлы [16]
RS232 [2]
Активные директории [1]
Директории [0]
Диски [0]
Корзина [5]
Порты [26]
Ресурсы [0]
Файлы [0]
Форматы файлов [15]
Ярлыки [0]

Наш опрос
Есть ли у Вас свой сайт?
Всего ответов: 48

Статистика

Онлайн всего: 2
Гостей: 2
Пользователей: 0

Форма входа

Главная » Статьи » Файловая система » CD-ROM

Как загрузить иконку CD-ROM
function GetCDIcon(Drive: Char): TIcon;
var
 ico: TIcon;
 ini: TIniFile;
 s, p: string;
 i, j: Integer;
begin
 //Abbrechen wenn "AutoRun.Inf" nicht existiert.
 //Abort if "AutoRun.inf" doesn't exists.
 if FileExists(Drive + ':\autorun.inf') = False then
 Exit;

 //"AutoRun.inf" offnen
 //Opens the "AutoRun.inf"
 ini := TIniFile.Create(Drive + ':\autorun.inf');
 ico := TIcon.Create;

 try
 //Dateinamen lesen
 //Read the filename
 s := ini.ReadString('Autorun', 'ICON', '');

 //Abbrechen, wenn kein Icon festgelegt wurde
 //Abort if there is no icon specified
 if s = '' then
 Exit;

 //Icon von Datei laden
 //load the icon from a file
 if FileExists(s) then
 ico.LoadFromFile(s);
 if FileExists(Drive + ':\' + s) then
 ico.LoadFromFile(Drive + ':\' + s);

 //Icon aus einer Resource laden
 //Load the icon from a Win32 resource
 if (FileExists(s) = False) and (FileExists(Drive + ':\' + s) = False) then
 begin
 for j := (Pos(',', s) + 1) to Length(s) do
 begin
 p := p + s[j];
 end;
 i := StrToInt(p);
 for j := Length(s) downto (Pos(',', s)) do
 Delete(s, j, Length(s));

 if FileExists(s) = False then
 s := Drive + ':\' + s;

 ico.Handle := ExtractIcon(hinstance, PChar(s), i);
 end;

 Result := ico;
 finally
 ini.Free;
 end;
end;
Категория: CD-ROM | Добавил: Angel (06.07.2008)
Просмотров: 426 | Рейтинг: 0.0/0
  Delphi Lab   Главная   Регистрация   Вход  
Интересная Цитата

Поиск

Магазин


Copyright MyCorp © 2025 Хостинг от uCoz