delphi Shutdown() 关机


本文整理自网络,侵删。

 delphi Shutdown() 关机

{
shutdown -s -t 0 立即关闭计算机
shutdown -l 立即注销计算机
shutdown -r -t 0 立即重启计算机
shutdown -a 取消关闭计算机
}
 
{在uses中引入 ShellAPI} 
uses ShellAPI;

{关机相关} 
//调用//  Shutdown(0); 
procedure Shutdown(sType:integer); 
begin 
  case  sType of 
    0: ShellExecute(Application.Handle, 'open', 'shutdown.exe', '-s -t 0', 0, SW_SHOWNORMAL);   {关闭计算机} 
    1: ShellExecute(Application.Handle, 'open', 'shutdown.exe', '-l', 0, SW_SHOWNORMAL);        {注销计算机} 
    2: ShellExecute(Application.Handle, 'open', 'shutdown.exe', '-r -t 0', 0, SW_SHOWNORMAL);   {重启计算机} 
    3: ShellExecute(Application.Handle, 'open', 'shutdown.exe', '-a', 0, SW_SHOWNORMAL);        {取消关闭计算机} 
  end; 
end;

相关阅读 >>

Delphi 绘制精美的签名图片

Delphi 使用泛型的 tarray 为动态数组排序

Delphi模仿“千千静听”滚动标题栏,非常简单!

Delphi xe filesizebyname 要引用哪些文件

Delphi里实现对图片base64编码解码

Delphi远程注入dll方法

Delphi 如何确定windows安装的语言

Delphi unigui 获取当前ip

Delphi 秒计算分钟、小时函数

Delphi 比较俩组ip地址是否一样

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...