|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
disable control-alt-delete using C# I am using the C# language for developing the software. How could I disable control-alt-delete buttons so that the user of the program could only use the dropdown menu's Exit option to quit the program? |
#2
| |||
| |||
Re: disable control-alt-delete using C# Start the taskmanager hidden.(can't kill a process) and if the key's hit again..it will stay hidden. Then close it when the exam is done. [DllImport("user32.dll")] Code: public static extern int FindWindow(string lpClassName, string lpWindowName); [DllImport("User32.dll")] public static extern Int32 SendMessage( int hWnd, // handle to destination window int Msg, // message int wParam, // first message parameter int lParam); // second message parameter private void Form1_Load(object sender, EventArgs e) { Process p = new Process(); p.StartInfo.WorkingDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System); p.StartInfo.FileName = "taskmgr.exe"; p.StartInfo.CreateNoWindow = true; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.Start(); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { const int WM_CLOSE = 0x0010; int taskManager = FindWindow("#32770", "Windows Task Manager"); SendMessage(taskManager, WM_CLOSE, 0, 0); } |
#3
| |||
| |||
Re: disable control-alt-delete using C# You can use this hint also, whenever another window is opened (including the Task Manager), your window gets a Deactivate event. For instance: private void MyForm_Deactivate (...) { Activate (); BringToFront (); Focus (); } This will already help keeping your window on top of most others. |
#4
| |||
| |||
Re: disable control-alt-delete using C# Quote:
Ctrl-Alt-Del does't activate TaskMgr if the OS is configured to switch the desktop, You can call TerminateProcess() with any proggie, WM_CLOSE must not never be sent, etc... Simply disable Ctrl-Alt-Del with the usual method with Win32 api |
#5
| |||
| |||
Re: disable control-alt-delete using C# Hi, I had also confused with this thread but when i checked it out it works properly. You can disable Ctrl-Alt-Del with the usual method with Win32 application, but this is just the programming method to do this. & this method is mentioned in msdn library. ![]() |
![]() |
|
Tags: controlaltdelete, disable |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to disable SLI when I cannot run Nvidia?s control panel? | Rucika | Monitor & Video Cards | 7 | 17-10-2011 06:27 PM |
how to disable control panel | Agilent | Windows Security | 3 | 28-03-2011 01:27 PM |
How to disable remote control with itunes | Deandre | Windows Software | 6 | 29-05-2010 03:36 PM |
How to disable the User Account Control in vista | M. Rafi | Windows Software | 4 | 21-07-2009 09:58 PM |
Partially disable UAC (User Account Control) | hayeden | Tips & Tweaks | 1 | 22-05-2009 10:33 PM |