>method _DecodeValue >lparameter pdwType, pcData, pnData > >local luRetVal > >luRetVal = .null. > >do case > case pdwType = REG_SZ > luRetVal = left( pcData, pnData-1 ) > > case pdwType = REG_DWORD > luRetVal = FromLong( pcData ) > > case pdwType = REG_BINARY > * provide read access to this type, but for registry safety reasons write is not supported > luRetVal = left( pcData, pnData ) > > otherwise > * Don't support anything other types >endcase > >return luRetVal > >*method _GetRegValue >lparameters pcValueName >* Obtains a value from a registry key > >this.mnErrorNum = ERROR_SUCCESS > >do case > case ( this.mnCurrentKey = 0 ) > this.mnErrorNum = ERROR_BADKEY > case ( type( "pcValueName" ) != "C" ) > this.mnErrorNum = ERROR_BADPARM >endcase > >if ( this.mnErrorNum != ERROR_SUCCESS ) > return this.mnErrorNum >endif > >local lpdwReserved, lpdwtype, lcData, lnData >lpdwReserved = 0 >lpdwtype = REG_NONE >lcData = space( this.mnMaxValueDataLen ) >lnData = len( lcData ) > >this.mnErrorNum = RegQueryValueEx( this.mnCurrentKey, pcValueName, lpdwReserved, @lpdwType, ; > @lcData, @lnData ) > >if ( this.mnErrorNum = ERROR_SUCCESS ) > this.mnKeyType = lpdwType > this.muKeyValue = this._DecodeValue( lpdwType, lcData, lnData ) >endif > >return this.mnErrorNum >