- Code: Select all Expand view RUN
#Include "FiveWin.ch"
STATIC oWnd
FUNCTION Main()
LOCAL oBar
DEFINE WINDOW oWnd TITLE "Deshabilitar UAC del Windows 7"
DEFINE BUTTONBAR oBar _3D OF oWnd
// EnableLUA
// 0-Desativar - deshabilitar
// 1-Ativar - activar
DEFINE BUTTON OF oBar ACTION UACV( 1 )
SET MESSAGE OF oWnd TO "Deshabilitar UAC del Windows 7" NOINSET CLOCK DATE KEYBOARD
ACTIVATE WINDOW oWnd
RETURN NIL
/ Para Windows Vista ou Seven a chave muda
FUNCTION UACV(nAtivar)
*****************************************************
* Grava o registro do aplicativo
*****************************************************
LOCAL cRunName, cRunKey, cRegKey
// EnableLUA
// 0-Desativar
// 1-Ativar
cRegValue:= nAtivar
cRegKey := "SOFTWARE\Microsoft\Security Center"
cRegRoot := HKEY_LOCAL_MACHINE
SETREGVAR( cRegRoot, cRegKey, "UACDisableNotify", cRegValue )
RETURN 0
/*
// para Windows XP
FUNCTION UAC(nAtivar)
*****************************************************
* Grava o registro do aplicativo
*****************************************************
LOCAL cRunName, cRunKey, cRegKey
// EnableLUA
// 0-Desativar
// 1-Ativar
cRegValue:= nAtivar
cRegKey := "Software\Microsoft\Windows\CurrentVersion\Policies\System"
cRegRoot := HKEY_LOCAL_MACHINE
SETREGVAR( cRegRoot, cRegKey, "EnableLUA", cRegValue )
RETURN 0
*/
FUNCTION SETREGVAR(nKey, cRegKey, cSubKey, uValue)
LOCAL oReg, cValue
nKey := IF(nKey == NIL, HKEY_CURRENT_USER, nKey)
uValue := IF(uValue == NIL, "", uValue)
oReg := TReg32():Create(nKey, cRegKey)
cValue := oReg:Set(cSubKey, uValue)
oReg:Close()
RETURN cValue
Gracias, saludos