Can someone please post an example how to write and read a registry value.
Thank in advance
Otto
registry value
registry value
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: registry value
Otto
function ReadRegistry()
LOCAL nHandle
LOCAL cValue
LOCAL dFecUltActu
if RegOpenKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) == 0
dFecUltActu := cToD( RegQueryValue( nHandle, "F.Ul.Actualizacion" , @cValue ))
RegCloseKey( nHandle )
endif
Return NIL
function WriteRegistry()
LOCAL nHandle
LOCAL cDateUltActu := dToC( DATE() )
if RegOpenKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) != 0
RegCreateKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) // Creo el Grupo.
if RegOpenKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) == 0 // Si existe.
RegSetValue( nHandle, "F.Ul.Actualizacion" ,cDateUltActu )
Endif
RegCloseKey( nHandle )
endif
Return NIL
function ReadRegistry()
LOCAL nHandle
LOCAL cValue
LOCAL dFecUltActu
if RegOpenKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) == 0
dFecUltActu := cToD( RegQueryValue( nHandle, "F.Ul.Actualizacion" , @cValue ))
RegCloseKey( nHandle )
endif
Return NIL
function WriteRegistry()
LOCAL nHandle
LOCAL cDateUltActu := dToC( DATE() )
if RegOpenKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) != 0
RegCreateKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) // Creo el Grupo.
if RegOpenKey( HKEY_CURRENT_USER, "SOFTWARE\MySoft", @nHandle ) == 0 // Si existe.
RegSetValue( nHandle, "F.Ul.Actualizacion" ,cDateUltActu )
Endif
RegCloseKey( nHandle )
endif
Return NIL
Toni Sales