利用API:SHShutDownDialog即可,参考:http://www.7880.com/Info/Article-4b835c20.htmlDeclare Function SHShutDownDialog Lib "shell32" Alias "#60"(ByVal YourGuess As Long) As Long
function ShutDownDialog(hwnd: HWND): LongBool; stdcall; external 'shell32.dll' index 60;procedure TForm1.Button1Click(Sender: TObject); begin ShutDownDialog(Handle); end;
begin
ShutDownDialog(Handle);
end;