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

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

•  TDictionary Custom Sort  6 741

•  Fast Watermark Sources  6 530

•  3D Designer  9 471

•  Sik Screen Capture  6 859

•  Patch Maker  7 306

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

•  ListBox Drag & Drop  6 113

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

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

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

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

•  Canvas Drawing  5 957

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

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

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

•  Paint on Shape  2 978

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

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

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

•  Пазл Numbrix  2 585

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

•  Игра HIP  2 325

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

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

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

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

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

•  HEX View  2 708

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

 
скрыть

Delphi Sources

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




Похожие по теме исходники

Load JPEG from RES

Snake from Art

CIE Chromaticity Diagrams

Palette Chromatique

 

Info from IP

QUIZ of Aromatic Plants

Flash and CD-ROM Safe Removal

Detach From Debugger