#Define HKEY_CLASSES_ROOT -2147483648 #Define HKEY_CURRENT_USER -2147483647 #Define HKEY_LOCAL_MACHINE -2147483646 #Define HKEY_USERS -2147483645 #Define REG_SZ 1 && String #Define REG_BINARY 3 && Binary data #Define REG_DWORD 4 && 32bits int #Define ERROR_SUCCESS 0 && OK Declare Integer RegOpenKey In Win32API ; Integer nHKey, String @cSubKey, Integer @nResult Declare Integer RegCloseKey In Win32API ; Integer nHKey Declare Integer RegSetValueEx In Win32API ; Integer hKey, String lpszValueName, Integer dwReserved,; Integer fdwType, String lpbData, Integer cbData Declare Integer RegQueryValueEx In Win32API ; Integer nHKey, String lpszValueName, Integer dwReserved,; Integer @lpdwType, String @lpbData, Integer @lpcbData Declare RtlMoveMemory In WIN32API ; INTEGER @DestNumeric, ; STRING @pVoidSource, ; INTEGER nLength Local lnCurValue,lcSubKey, lcOption lcSubKey = 'Console' lcOption = 'NumberOfHistoryBuffers' lnCurValue = DWORD_GetRegValue(HKEY_CURRENT_USER, lcSubKey, lcOption) If !IsNull(lnCurValue) ? 'Current value',lnCurValue DWORD_SetRegValue(HKEY_CURRENT_USER, lcSubKey, lcOption,15) ? 'After set',DWORD_GetRegValue(HKEY_CURRENT_USER, lcSubKey, lcOption) DWORD_SetRegValue(HKEY_CURRENT_USER, lcSubKey, lcOption,lnCurValue) ? 'After restore',DWORD_GetRegValue(HKEY_CURRENT_USER, lcSubKey, lcOption) endif Function DWORD_GetRegValue Lparameters tnRegRoot, tcSubKey, tcOption Local lnKeyHandle,lpdwType,lpcbData,lpbData,lnValue m.lnKeyHandle = 0 m.lpdwType = REG_DWORD m.lpcbData = 4 m.lpbData = Replicate(Chr(0),4) m.lnValue=0 If ( RegOpenKey(tnRegRoot, tcSubKey, @lnKeyHandle) = ERROR_SUCCESS ) RegQueryValueEx(m.lnKeyHandle,tcOption, 0,@lpdwType,@lpbData,@lpcbData) RtlMoveMemory(@lnValue, lpbData, 4) RegCloseKey(m.lnKeyHandle) Return m.lnValue Else Return .null. EndIf EndFunc Function DWORD_SetRegValue Lparameters tnRegRoot, tcSubKey, tcOption, tnValue Local lnKeyHandle,lpdwType,lpcbData,lpbData m.lnKeyHandle = 0 m.lpdwType = REG_DWORD m.lpcbData = 4 m.lpbData = Num2Char(tnValue,4) If ( RegOpenKey(tnRegRoot, tcSubKey, @lnKeyHandle) = ERROR_SUCCESS ) RegSetValueEx(m.lnKeyHandle,tcOption, 0,@lpdwType,@lpbData,@lpcbData) RegCloseKey(m.lnKeyHandle) EndIf endfunc Function Num2Char lparameters tnNum, tnSize Local ix,lcnum lcNum = '' For ix=1 to tnSize lcNum = lcNum + Chr(int(tnNum/(256^(ix-1)))%256) endfor return lcNum endfuncPS:Only changing the declaration was sufficient for your other thread.