本文整理自网络,侵删。
uses shellapi;
if Application.MessageBox(System.Pchar('关闭计算机?'), '询问', 1 + 32) = id_OK then begin ShellExecute(Handle,'open','shutdown.exe','-f -s -t 0', nil, SW_HIDE); end;
相关阅读 >>
Delphi : tstringlist的find,indexof和sort
在一个exe文件中查找指定内容,找到则返回起始位置,否则返回0
更多相关阅读请进入《Delphi》频道 >>