[Lazarus] Power Off/Restart a PC

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Power Off/Restart a PC

Fábio Henrique de Souza
Hi all,

How to power off and restart a computer with Lazarus?
(cross-platform or Windows and Linux)

Thanks,
Fábio

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Power Off/Restart a PC

Felipe Monteiro de Carvalho
In Linux you can try something like

uses BaseUnix, Unix;
Shell('restart');

--
Felipe Monteiro de Carvalho

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Power Off/Restart a PC

Felipe Monteiro de Carvalho
Ah, sorry =p

Shell('reboot');

--
Felipe Monteiro de Carvalho

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Power Off/Restart a PC

Nikolay Nikolov
In reply to this post by Fábio Henrique de Souza
On 04/07/2011 04:08 PM, Fábio Henrique de Souza wrote:
Hi all,

How to power off and restart a computer with Lazarus?
(cross-platform or Windows and Linux)

For Windows, use the ExitWindowsEx function:

 http://msdn.microsoft.com/en-us/library/aa376868%28v=vs.85%29.aspx

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Power Off/Restart a PC

Fábio Henrique de Souza
Thanks

Em 07-04-2011 15:17, Nikolay Nikolov escreveu:
On 04/07/2011 04:08 PM, Fábio Henrique de Souza wrote:
Hi all,

How to power off and restart a computer with Lazarus?
(cross-platform or Windows and Linux)

For Windows, use the ExitWindowsEx function:

 http://msdn.microsoft.com/en-us/library/aa376868%28v=vs.85%29.aspx
-- _______________________________________________ Lazarus mailing list [hidden email] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Power Off/Restart a PC

leledumbo
Administrator
Here, take mine (Windows only, adapt to Linux yourself):
WinManip.pas