Главная страница
    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.035 c
3-1079272168
BAYES
2004-03-14 16:49
2004.04.18
MSAccess


1-1080734556
SisiusP
2004-03-31 16:02
2004.04.18
Перехват ShortCut через ApplicationEvents?


7-1076701580
Khabibulin
2004-02-13 22:46
2004.04.18
Спящий режим


6-1075652604
Александр
2004-02-01 19:23
2004.04.18
Как отправить письмо?????????????


1-1080811748
KapitanSerg
2004-04-01 13:29
2004.04.18
Конвертация RTF => TXT





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский