(SST) ShlWAPIFunctionInfo Version 1.0

Developer Reference
(SST) ShlWAPIFunctionInfo IsValidHandle Function
Global, utility function that verifies that the specified value is not an invalid handle.
Scope
Local (i.e. this function can be only called/accessed from code in the unit in which it is implemented.
Syntax
FUNCTION IsValidHandle(ahandle : THandle) : BOOLEAN;  
Parameters
ahandle [in] An usigned 32-bit value of type THandle that is interpreted as the handle to check.
Return Values
Returns TRUE (= 1) if the specified parameter is neither 0 nor INVALID_HANDLE_VALUE (= -1), FALSE (= 0) otherwise.
Remarks
This function checks the validity of a handle more thoroughly than the functions used in the Borland, Delphi SDK, in that it also checks whether the handle was assigned a value that explicitly marks it as an invalid handle.
Example
PROCEDURE TForm1.OnDestroy(Sender : TObject); BEGIN IF IsValidHandle(DllHandle) THEN FreeLibrary(DllHandle); END;
Requirements
Unit (Declared and implemented in) SSTNewUnit.pas
Library SSTNewUnit.dcu/SSTNewUnit.obj
Unicode Implemented as ANSI version only.
See Also
TForm1, Source Code.
 
Windows APIs: GetLastError, SetLastError


Document/Contents version 1.00
Page/URI last updated on April 28, 2022
 
Copyright © Stoelzel Software Technologie (SST) 2010 - 2017
Suggestions and comments mail to:
webmaster@stoelzelsoftwaretech.com