by Romeo » Thu Sep 27, 2007 3:26 pm
Ho risolto !
#INCLUDE "FiveWin.ch"
#define HKEY_LOCAL_MACHINE 2147483650
#define REG_SZ 0
#define KEY_ALL_ACCESS 983103
function main
local _ver_wind:=ver_wind()
local _l_isvista
if int(val(_ver_wind))=6
? "Sei su Vista"
else
? "Non Sei su Vista"
endif
return nil
*
function ver_wind()
LOCAL hKey := 0
LOCAL nType := REG_SZ
LOCAL cData := SPACE( 256 )
LOCAL nSize := LEN( cData )
REGOPENKEY( HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows NT\CurrentVersion", 0, KEY_ALL_ACCESS, @hKey )
REGQUERYVALUE( hKey, "CurrentVersion", 0, @nType, @cData, @nSize)
REGCLOSEKEY( hKey )
cData = LEFT( cData, AT( CHR( 0 ), cData ) - 1 )
RETURN cData
DLL32 FUNCTION REGOPENKEY( hKey AS LONG, cSubKey AS LPSTR, nOptions AS DWORD, nSamDesired AS DWORD, @nHandle AS PTR ) AS LONG;
PASCAL FROM "RegOpenKeyExA" LIB "advapi32.dll"
DLL32 FUNCTION REGQUERYVALUE( hKey AS LONG, cValueName AS LPSTR, nReserved AS LONG, @nType AS PTR, @cData AS LPSTR, @nSize AS PTR ) AS LONG;
PASCAL FROM "RegQueryValueExA" LIB "advapi32.dll"
DLL32 FUNCTION REGCLOSEKEY( hKey AS LONG ) AS LONG;
PASCAL FROM "RegCloseKey" LIB "advapi32.dll"
*