ok, i've done this plenty of times before, but i'm currently having a brain hemerage and can't figure it out.strData is returning ""....VB Code:
Private Sub Form_Activate() Dim lngHKey As Long Dim strData As String Dim lngLenData As Long If RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion", _ 0, KEY_ALL_ACCESS, lngHKey) Then MsgBox "Couldn't open key!", vbCritical, "Error" Unload Me End If If RegQueryValueEx(lngHKey, "ProductKey", 0, REG_SZ, strData, 29) Then MsgBox "Couldn't retrieve Windows 98 product key!", vbCritical, "Error!" RegCloseKey lngHKey Unload Me End If RegCloseKey lngHKey lblProductKey.Caption = strData End Sub
cheers guys
darrel.


Reply With Quote
