Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
The easyest way to force shutdown a PC. Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
How to shutdown a PC. 22-Jan-04
Category
System
Language
Delphi All Versions
Views
596
User Rating
8
# Votes
1
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   procedure TForm1.Button1Click(Sender: TObject);
3   begin
4    {use EWX_LOGOFF  to log off
5     use EWX_SHUTDOWN to shut down
6     use EWX_REBOOT to reboot
7     use EWX_FORCE  to do a force command with a cobination of Power off, or Reboot or 
8   shutdown or logoff
9     use EWX_POWEROFF  to power off
10   }
11  
12  
13    SetShutdownPrivilege(true) ;//set rights to use this pivrilege
14  
15    if not ExitWindowsEx(EWX_FORCE + EWX_POWEROFF , 0) then
16     messagedlg('wasn''t able to shutdown PC!',mterror,[mbok],0);
17  
18    SetShutdownPrivilege(false); //turn of rights
19  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC