简体   繁体   中英

Preventing windows to Ctrl+Alt+Del at logon

I am trying to prevent windows to show the Ctrl+Alt+Del menu at logon, for that, I have to flip a registry value from 0 to 1, I developed this piece of code:

const string subkey = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon";

RegistryKey myKey = Registry.LocalMachine.OpenSubKey(subkey, true);
myKey.SetValue("DisableCad", "1", RegistryValueKind.DWord);
myKey.Close();

But when I restart windows the Crtl+Alt+Del menus still shows up. Anyone knows whats the problem?

Thanks to Hans Passant I found the answer.

The problem was that I was running this code for a 64-bit computer when I was compiling it for 32-bit...

To change this I just had to got to Project > Properties > Build tab, and uncheck the "Prefer 32-bit" checkbox.

Thank you Hans.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM