Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.04.18;
Скачать: CL | DM;

Вниз

Где ошибка   Найти похожие ветки 

 
Seldon   (2004-02-11 13:51) [0]

Здрасьте!


function GetShellIcon(Index:Integer;Icon:TIcon;Large:Boolean=false):TIcon;
var
 Sys:String;
 LI,SI:HICON;
begin
 Icon:=TIcon.Create;
 SetLength(Sys,MAX_PATH);
 SetLength(Sys,GetSystemDirectory(@Sys[1],MAX_PATH));
 if Sys[Length(Sys)]<>"\" then
   Sys:=Sys+"\";
 ExtractIconEx(PAnsiChar(Sys+"shell32.dll"),Index,LI,SI,2);
 if Large then
   Icon.Handle:=LI  //AV
 else
   Icon.Handle:=SI; //AV  
end;


Этот код генерирует AV в помеченных строках. Почему?


 
Семен Сорокин ©   (2004-02-11 14:13) [1]

The ExtractIconEx function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file.

HICON ExtractIconEx(

   LPCSTR lpszFile,
   int nIconIndex,
   HICON FAR * phiconLarge,
   HICON FAR * phiconSmall,
   UINT nIcons  
  );


Parameters

lpszFile

Pointer to a null-terminated string specifying the name of an executable file, DLL, or icon file.

nIconIndex

Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1 and phIconLargeand phiconSmall are both NULL, the function returns the total number of icons in the specified file.
phiconLarge

Pointer to an array of handles of large icons returned. This parameter can be NULL.
phiconSmall

Pointer to an array of handles of small icons returned. This parameter can be NULL.

nIcons

Specifies the count of the number of icons to extract.



Return Values

If the function succeeds, the return value is the handle to an icon. If the file specified was not an executable file, DLL, or icon file, the return value is 1. If no icons were found in the file, the return value is NULL.


 
Seldon   (2004-02-11 14:26) [2]

Всё это прекрасно, но какое отношение имеет к проблеме?


 
Семен Сорокин ©   (2004-02-11 14:44) [3]

Index чему равен?


 
Seldon   (2004-02-11 18:31) [4]

6


 
Seldon   (2004-02-11 22:20) [5]

Ау!


 
Rouse_ ©   (2004-02-11 22:50) [6]

> ExtractIconEx(PAnsiChar(Sys+"shell32.dll"),Index,LI,SI,2);

А с какого перепугу ты двойку делаешь? Единицу надобно...



Страницы: 1 вся ветка

Текущий архив: 2004.04.18;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.034 c
1-1080978292
ЛОМАК
2004-04-03 11:44
2004.04.18
Диалоговые окна в моей програме


3-1079688643
Romeo
2004-03-19 12:30
2004.04.18
Удаленный доступ к двум (и более) таблицам базы через DCOM


14-1080113981
ИМХО
2004-03-24 10:39
2004.04.18
Еще одна задачка для шахматистов


3-1079953049
Yermek
2004-03-22 13:57
2004.04.18
Чтение и запис чисел и текста в BLOB поля


14-1080238428
Yegor
2004-03-25 21:13
2004.04.18
Бесплантый интернет