Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn off windows box C#

Tags:

c#

windows

I wonder if anyone know how to open this box with a c# command?

enter image description here

Thanks in advance!

like image 859
user943369 Avatar asked Dec 13 '12 18:12

user943369


People also ask

How do I Turn Off my PC in Windows 10?

Report a support scam Shut down (turn off) your PC Windows 10More... Less To turn off your PC in Windows 10, select the Start button, select the Power button, and then select Shut down. I'm having trouble opening the Start menu

How do I Turn Off Action Center in Windows 10?

To disable Action Center, set the option to Enabled. Click OK and then restart your computer (just logging off and back on won’t do the job). If you want to enable it again, come back to this screen and set it to Disabled or Not Configured.

How do I Turn Off system icons in Windows 10?

You can also open the Start menu and click “Settings” to get to this window. In the System window, click the “Notifications & actions” category on the left. On the right, click the “Turn system icons on or off” link.

How do I Turn Off the Xbox Game Bar?

Click the switch to turn it Off. You can also click the switch under Record audio when I record a game to turn it Off. There are actually 3 ways to turn off the Xbox Game bar completely. One: disable through Settings App. Press Win + I or use other ways to open Windows Settings. Locate and select Gaming.


1 Answers

You must add reference to Shell32.dll (COM -> "Microsoft Shell Controls And Automation") and use this code:

 Shell32.Shell shell = new Shell32.Shell();
 shell.ShutdownWindows();
like image 93
kmatyaszek Avatar answered Oct 07 '22 03:10

kmatyaszek