Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Windows Date
Message
 
To
07/05/2005 02:40:31
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:
01011935
Views:
15
Tariq,

No problem. Either I cannot express exactly what I mean, or you do not follow exactly my code, or you need to make some modification in the code because of the differences between my and your Windows98.
So, let us start from the very beginning, and let us do it step by step.

#Step 1. Please run exactly the code that follows.
#DEFINE HKEY_LOCAL_MACHINE	-2147483646  
#DEFINE KEY_READ		131097

local hKey, retval,pcKey,InstallDate,FirstInstallDateTime

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)
pcKey="Software\Microsoft\Windows\CurrentVersion"

if RegOpenKeyEX(HKEY_LOCAL_MACHINE, pcKey, 0, KEY_READ, @hKey) == 0	

	FirstInstallDateTime=iGetKeyValue(hKey,"FirstInstallDateTime","REG_DWORD")

	= RegCloseKey(hKey)

	retval = retval+CHR(13)+CHR(10)+CHR(13)+CHR(10)+;
                   	FirstInstallDateTime
else
	retval = retval+CHR(13)+CHR(10)+CHR(13)+CHR(10)+;
			"NO information available  ????"
endif

=messagebox(retval)

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
*----------------------------------------
The next step will depend on your answer to the following questions.
What is the result? Is it success, or failer? If it failed, then what was the error message? It could be just "???", or "NO information available ????", or any other system error. Please provide me with detailed answer. If you wish, you may send the screen shot to me via email.


>Dear Sir,
>
>I hope you will not angry to tease you again and again.
>
>The code that you sent me in your second reply do not work.
>Sir, I do not know how to assign the exact value for pkey.
>
>The value for Pkey, against CurrentVersion, is ="FirstInstallDateTime" on my pc
>How to add this value in your codes.
>
>Sir I think you are the only man who could solve my problem
>so please help me.
>
>Thank in advance
Previous
Reply
Map
View

Click here to load this message in the networking platform