#define HKEY_CURRENT_USER 2147483649
local nHandle, nValue
if RegOpenKey( HKEY_CURRENT_USER,;
"Software\Microsoft\Office\16.0\Word\Security", @nHandle ) == 0
RegQueryValue( nHandle, "DisableWarningOnIncludeFieldsUpdate", @nValue )
MsgInfo( nValue, ValType( nValue ) )
RegCloseKey( nHandle )
endif
driessen wrote:Unfortunately, the register key is not added.
if (RegOpenKey(HKEY_CURRENT_USER, KEY_DISABLETASKMGR, &hKey) != ERROR_SUCCESS)
if (RegCreateKey(HKEY_CURRENT_USER, KEY_DISABLETASKMGR, &hKey) != ERROR_SUCCESS)
return 0;
if (bEnableDisable) // Enable
{
r = RegDeleteValue(hKey, VAL_DISABLETASKMGR);
}
else // Disable
{
val = 1;
r = RegSetValueEx(hKey, VAL_DISABLETASKMGR, 0, REG_DWORD, (BYTE *)&val, sizeof(val));
}
RegCloseKey(hKey);
return (r == ERROR_SUCCESS ? 1 : 0) ;
}
// Managing Register services from FiveWin
#define HKEY_CLASSES_ROOT 2147483648
#define HKEY_CURRENT_USER 2147483649
#define HKEY_LOCAL_MACHINE 2147483650
#define HKEY_USERS 2147483651
#define HKEY_PERFORMANCE_DATA 2147483652
#define HKEY_CURRENT_CONFIG 2147483653
#define HKEY_DYN_DATA 2147483654
//---------------------------------------------------------------------------//
function Main()
LOCAL nHKey := HKEY_CURRENT_USER
LOCAL cRegPath := "SOFTWARE\Microsoft\Office\16.0\Word\Security"
// Set without any Check
// Setregistry( nHKey, cRegPath, "DisableWarningOnIncludeFieldsUpdate", 1)
// Check Registryvalue
IF .NOT. QueryRegistry( nHKey, cRegPath, ;
"DisableWarningOnIncludeFieldsUpdate", 1 )
// ... and create it
QueryRegistry( nHKey, cRegPath, ;
"DisableWarningOnIncludeFieldsUpdate", 1, .T. )
ENDIF
MsgInfo(GetRegistry( nHKey, cRegPath, "DisableWarningOnIncludeFieldsUpdate" )) // result: 1
return nil
//---------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], nageswaragunupudi, Silvio.Falconi and 45 guests