Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  4 841

•  TDictionary Custom Sort  6 830

•  Fast Watermark Sources  6 609

•  3D Designer  9 575

•  Sik Screen Capture  6 951

•  Patch Maker  7 395

•  Айболит (remote control)  7 345

•  ListBox Drag & Drop  6 203

•  Доска для игры Реверси  98 212

•  Графические эффекты  7 519

•  Рисование по маске  6 803

•  Перетаскивание изображений  5 656

•  Canvas Drawing  6 034

•  Рисование Луны  5 826

•  Поворот изображения  5 276

•  Рисование стержней  3 868

•  Paint on Shape  3 023

•  Генератор кроссвордов  3 981

•  Головоломка Paletto  3 155

•  Теорема Монжа об окружностях  3 996

•  Пазл Numbrix  2 636

•  Заборы и коммивояжеры  3 450

•  Игра HIP  2 364

•  Игра Go (Го)  2 283

•  Симулятор лифта  2 678

•  Программа укладки плитки  2 242

•  Генератор лабиринта  2 798

•  Проверка числового ввода  2 401

•  HEX View  2 744

•  Физический маятник  2 430

 
скрыть

Как загрузить иконку 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;

Copyright © 2004-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте