API - dialogos desligar windows e pouco espaco |
Top Previous Next |
// chamar a tela que desliga o Windows
procedure ExitWindowsDialog(ParentWnd: HWND); stdcall; external 'Shell32.dll' index 60;
procedure TForm1.Button1Click(Sender: TObject); begin ExitWindowsDialog(0) end;
// dialog pouco espaco em disco
procedure SHHandleDiskFull(Owner: HWND; Drive: UINT); stdcall; external 'Shell32.dll' index 185;
procedure TForm1.Button1Click(Sender: TObject); begin SHHandleDiskFull(0, 2); end;
// Note that second parameter is Drive number where 0 is A:, 1 is B:, 2 is C: etc // Don't forget to add ShlObj and ShellAPI units into uses-clause.
|