FUNCTION GetWinVersion RETURNS INTEGER:
DEFINE VARIABLE cValue AS CHARACTER NO-UNDO. DEFINE VARIABLE libName AS CHARACTER NO-UNDO. DEFINE VARIABLE hCall AS HANDLE NO-UNDO. CREATE CALL hCall. ASSIGN hCall:CALL-NAME = "GetVersion" hCall:LIBRARY = "kernel32.dll" hCall:CALL-TYPE = DLL-CALL-TYPE hCall:RETURN-VALUE-DLL-TYPE = "LONG". hCall:INVOKE( ). cValue = hCall:RETURN-VALUE. DELETE OBJECT hCall. RETURN cValue. END FUNCTION. |