Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Herausfinden wie viele Icons in einer Datei integriert sind (https://www.delphipraxis.net/48452-herausfinden-wie-viele-icons-einer-datei-integriert-sind.html)

Zacherl 25. Jun 2005 15:44


Herausfinden wie viele Icons in einer Datei integriert sind
 
Hallo,
wie kann mit Delphi die Anzahl von Icons, die in einer Datei sind ermitteln?
In z.B. Shell32.dll sind viele Icons als Ressource eingebunden...Die Funktion soll die genaue Zahl ermitteln.

Florian

Kroko1999 25. Jun 2005 15:49

Re: Herausfinden wie viele Icons in einer Datei integriert s
 
Zitat:

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

HICON ExtractIcon(

HINSTANCE hInst, // instance handle
LPCTSTR lpszExeFileName, // filename of file with icon
UINT nIconIndex // index of icon to extract
);


Parameters

hInst

Identifies the instance of the application calling the function.

lpszExeFileName

Points 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, the function returns the total number of icons in the specified file.



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 is 1. If no icons were found in the file, the return value is NULL.

Zacherl 25. Jun 2005 15:53

Re: Herausfinden wie viele Icons in einer Datei integriert s
 
Danke,
dann muss ich wohl die Funktion benutzen. Habs vorher mit ExtractAssociatedIcon aus der ShellAPI gemacht.

Florian

scp 25. Jun 2005 15:57

Re: Herausfinden wie viele Icons in einer Datei integriert s
 
Ich dachte du wolltest die Anzahl usw. wissen?

In Delphi 7 (und bei älteren) gibt es eine Demo, mit der man gut sehen kann, wie die Header und Sections einer EXE ausgewertet werden können. Schau mal unter Delphi7\Demos\ResXplor.

EDIT: Kommentar in der Beschreibung übersehen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz