Главная страница
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.47 MB
Время: 0.023 c
4-1074765750
Vova_2004
2004-01-22 13:02
2004.04.18
прозрачный Static


3-1079724857
ZUK
2004-03-19 22:34
2004.04.18
TJvMemoryData - Lookup Field


1-1080786461
Артем К.
2004-04-01 06:27
2004.04.18
Казус в создании MDI-приложения с использование баз данных!


3-1079596522
sheriff
2004-03-18 10:55
2004.04.18
ADOConnection &amp; Service Application


6-1076419762
Prankster
2004-02-10 16:29
2004.04.18
Отправка почты