I am developing an application in c++ from which a user can disable task manager from within the application (and little more functions). Here's how i did it in visual c++ :
HKEY regHandle;
DWORD dwValue = 1;
BYTE* data = (BYTE*)&dwValue;
RegCreateKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", 0, NULL, NULL, KEY_WRITE | KEY_WOW64_32KEY,NULL , ®Handle ,NULL );
RegSetValueEx(regHandle,"DisableTaskmgr",0, REG_DWORD,data ,sizeof(DWORD));
It worked well in administrator account. But in limited user account and guest account, it doesn't work. It tried to change UAC level to administrative privileges / Highest available. Both didn't work. I also checked whether i can do it via writing the reg value to HKEY_LOCAL_MACHINE
. Sadly, that too failed.
I've googled well, and searched stackoverflow, but didn't find a solution. Manually editing group policy / registry is not at all a solution, i've to do it from inside my application as and when needed. Thanks in advance for your help.