all is said in the title, how can I simulate the combination Ctrl+Alt+DEL?
I tried this:
SendKeys.Send("^(%({DEL}))")
SendKeys.Send("^(%{DEL})")
SendKeys.Send("^%{DEL}")
But none worked. I am working on VB.NET and Windows XP SP3
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I finally found this C++ code on CodeProject, which works well when launched as System user. Therefore, I converted the code into a dll, and called the function from my code.
Here is the c++ code (you can use the ErrorExit example function that uses
GetLastErrorfrom MSDN in case a problem occured):You also need to add a .def file to the project to export the function correctly (the project is named AltCtrlDelCpp) and tell the linker that the definition file of the module is this file
Then, in the .NET solution, you add the dll to the project, configures it so that it is always copied in the output directory, and you just use DllImport to import the function:
C# Code
VB.NET Code
In VB.NET, you also need to add the attribute to the Sub Main :
Then you just have to call the
SimulateAltControlDelfunction and there you go. Please note that I had this work only for a Console Apps, it didn’t work in winform apps.