Главная страница
    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.45 MB
Время: 0.048 c
3-1079597149
sohat
2004-03-18 11:05
2004.04.18
Как оформить запрос к двум базам через BDE ?


1-1080820739
Diver
2004-04-01 15:58
2004.04.18
Как вывести на форму текст состоящий из разных шрифтов?


7-1076497137
Terry
2004-02-11 13:58
2004.04.18
Определение точки монтирования диска по имени устройства


1-1080636519
Question2004
2004-03-30 12:48
2004.04.18
Компонента TWebBrowser


7-1076682950
Шурик Ш
2004-02-13 17:35
2004.04.18
Забыл... Как запустить из своего приложения другой EXE-шник?





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