Hi everyone. I'm working on an application, and I need to be able to disable Ctrl+Alt+Del in XP and Vista. My code accesses the registry in order to do so. It works in XP, but doesn't work in Vista. Below please find the code I'm using.
RegistryKey regKey;
string keyValueInt = "1";
string subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
try
{
regKey = Registry.CurrentUser.CreateSubKey(subKey);
regKey.SetValue("DisableTaskMgr", keyValueInt);
regKey.Close();
}
catch (Exception ex)
{
//MessageBox.Show(ex.ToString());
CustomMessageBox message = new CustomMessageBox(ex.ToString(), false);
if (DialogResult.OK == message.ShowDialog()) { }
message.Dispose();
}
Ontop of that, I also have to be able to disable Ctrl+Tab and Alt+F4 in both XP and Vista. Does anyone have any ideas? Thanks.
Loading
BryanPosted Sep 15, 2009, 11:41 AM
BryanPosted Sep 2, 2009, 1:23 AM
I tried that code, and it disabled the windows buttons, which was great. But I don't know how it'll be able to disable Ctrl+Alt+Del, or Ctrl+Tab, or Alt+F4. Let me know if you have any ideas on how to get this working. Thanks.
Master BillaPosted Sep 2, 2009, 12:55 AM
have you tired my link code snippet?
thank you
Roei BarPosted Sep 2, 2009, 12:35 AM
Kirtan PatelPosted Sep 1, 2009, 11:30 PM
Here is Code to Accomplish your task
dont forget to mark "Do you like answer" please it will give me some credits :)
private void button1_Click(object sender, EventArgs e)
{
RegistryKey rkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies",true);
rkey.CreateSubKey("System",RegistryKeyPermissionCheck.Default);
rkey.Close();
RegistryKey rkey2 = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System", true);
rkey2.SetValue("DisableTaskMgr", 1);
rkey2.Close();
}
Master BillaPosted Sep 1, 2009, 10:30 PM
We did, see here code
http://www.aghausman.net/dotnet/disable-special-keys-in-win-app-c.html
thank you
BryanPosted Sep 1, 2009, 2:54 PM
Roei BarPosted Sep 1, 2009, 2:12 PM
its able todo everything you wanted, but i am not sure it will work in Windows Vista.
Vista has no GINA.dll so the only idea i have for you is to create a Keyboard Filter
look @ the following
http://live.sysinternals.com/ctrl2cap.exe
hope it helps you out