SetSystemPowerState

[DllImport("coredll.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern bool SetSystemPowerState(
   string psState,
   int StateFlags,
   int Options
);

Microsoft documentation: Link

Last updated