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

Roei BarRank #1,271 · 1.4K reputationPosted Sep 1, 2009, 10:12 AM EDT
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
Bryan108 reputationPosted Sep 1, 2009, 10:54 AM EDT
Master BillaRank #2,229 · 630 reputationPosted Sep 1, 2009, 6:30 PM EDT
We did, see here code
http://www.aghausman.net/dotnet/disable-special-keys-in-win-app-c.html
thank you
Kirtan PatelRank #292 · 8.6K reputationPosted Sep 1, 2009, 7:30 PM EDT
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();
}
Roei BarRank #1,271 · 1.4K reputationPosted Sep 1, 2009, 8:35 PM EDT
Master BillaRank #2,229 · 630 reputationPosted Sep 1, 2009, 8:55 PM EDT
have you tired my link code snippet?
thank you
Bryan108 reputationPosted Sep 1, 2009, 9:23 PM EDT
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.
Bryan108 reputationPosted Sep 15, 2009, 7:41 AM EDT