Several errors of Borland Delphi7 were found on Saturday.
1 There is a function in the Win32 API:
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
Specifier 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.
Declaring this in the shellapi.pas file of Borland Delphi7:
{$ Externalsym extracticonex}
Function ExtracticOnex (LPSZFILE: PCHAR; NICONINDEX: Integer;
Var Phiconlarge, Phiconsmall: Hicon; Nicons: UINT): UINT; stdcall;
The prototype is the HICON pointer, and Borland is directly declared into Hicon.
If you want to use this function, you have to re-declare it.
For everyone a statement:
TYPE thiconarray = array [0..0] of hicon; type phiconarray = ^ thiconarray;
function ExtractIconEx (lpszFile: PAnsiChar; nIconIndex: Integer; phiconLarge: PhIconArray; phiconSmall: PhIconArray; nIcons: UINT): UINT; stdcall; external 'shell32.dll' name 'ExtractIconEx'; 2Delphi7 sdk help in this function also has a problem:
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
Identifier 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 .
NiconIndex can not be handed over to UNIT type, but the comment says "if this value is -1, the function returns the total number of icons in the specified file." But the return value did not mention "The Total Number of Icons in the Specified" ". The actual use does not know -1, but I want to use it in delphi5. Borland's documentation is really unsearous.
3
Delphi7
Published
Alphablend
This property can be
2000
The above is transparent, but
98
Can't do it. If
98
In use
Alphablend
This one
Win32 API
Functions have implemented form transparency, compiler will report an error (and the attribute is will definitely).