Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Система";
Текущий архив: 2004.04.18;
Скачать: [xml.tar.bz2];

Вниз

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

 
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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.028 c
3-1079855329
Cerber
2004-03-21 10:48
2004.04.18
Моя двигла


3-1079606654
Чайник.
2004-03-18 13:44
2004.04.18
DBComboBox?


3-1079615388
Лысый
2004-03-18 16:09
2004.04.18
ADOConnection


8-1073550312
lex
2004-01-08 11:25
2004.04.18
Перемотка видео по ключевым кадрам.


6-1076399932
Роман
2004-02-10 10:58
2004.04.18
Прикреплённые файлы к письму





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский