Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Date
Message
 
To
29/04/2005 02:35:33
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01009567
Message ID:
01009632
Views:
16
Something like this:
#DEFINE HKEY_LOCAL_MACHINE -2147483646  
#DEFINE KEY_READ	131097

local  hKey, retval

declare long RegCloseKey in ADVAPI32.DLL integer nHKey
declare long RegOpenKeyEx in ADVAPI32.DLL;
			integer nHKey, string cSubKey, integer nOptions, ;
			integer nAccess, integer @cResult
declare long RegQueryValueEx in ADVAPI32.DLL;
			integer nHKey, string cValueToGet, integer nReserved, ;
			integer @nType, string @cBufferData, integer @nBufferLen
			
hKey = 0
retval=OS(1)

IF "NT" $ retval OR retval="Windows 5."		&&NT, XP
	pcKey="Software\Microsoft\Windows NT\CurrentVersion"
ELSE
	pcKey="Software\Microsoft\Windows\CurrentVersion"
ENDIF

if RegOpenKeyEX(HKEY_LOCAL_MACHINE, pcKey, 0, KEY_READ, @hKey) == 0
	?retval,	iGetKeyValue(hKey,"InstallDate","REG_DWORD")
	
	= RegCloseKey(hKey)
endif

Return
*-----------------------------
PROCEDURE iGetKeyValue
LPARAMETERS hKey, ValueName, pcType
LOCAL uDataType,nBufLen,cReturnData, retval

uDataType = 0
nBufLen = 254
cReturnData = space(nBufLen)

IF RegQueryValueEx(hKey, ValueName, 0, @uDataType, @cReturnData, @nBufLen) =0
		retval= trans(DATETIME(1970,1,1,0,0,0) + buf2dword(cReturnData))
ELSE
	retval="???"
ENDIF
RETURN 	ValueName+" "+retval
*------------------------------------
FUNCTION  buf2dword (lcBuffer) 
RETURN; 
    Asc(SUBSTR(lcBuffer, 1,1)) + ; 
    Asc(SUBSTR(lcBuffer, 2,1)) * 256 +; 
    Asc(SUBSTR(lcBuffer, 3,1)) * 65536 +; 
    Asc(SUBSTR(lcBuffer, 4,1)) * 16777216 
ENDFUNC 
>Dear Experts
>
>Is it possibe to findout Windows98 installation date, with VFP codes?
>If yes then please help me.
>
>Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform