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
How to remotly shutdown a PC on a network. 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
Remotly shutdown a PC on a network. 12-Jun-04
Category
Win API
Language
Delphi All Versions
Views
483
User Rating
10
# Votes
1
Replies
0
Publisher:
Darley, F. Joe
Reference URL:
			1   
2   unit Unit1;
3   
4   interface
5   
6   uses
7     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
8     Dialogs, StdCtrls;
9   
10  type
11    TForm1 = class(TForm)
12      Button1: TButton;
13      procedure Button1Click(Sender: TObject);
14    private
15      { Private declarations }
16    public
17      { Public declarations }
18    end;
19  
20  var
21    Form1: TForm1;
22  
23  implementation
24  
25  {$R *.dfm}
26  
27  procedure TForm1.Button1Click(Sender: TObject);
28  begin
29  if InitiateSystemShutdown(pchar('Remote PC Name'),
30  pchar('Shutdown in 30 seconds'),30,true,true) then
31  showmessage('Success!')
32  else
33  showmessage('Failure to shutown PC');
34  
35  {
36  BOOL InitiateSystemShutdown(
37  
38      LPTSTR lpMachineName,	// address of name of computer to shut down
39      LPTSTR lpMessage,	// address of message to display in dialog box
40      DWORD dwTimeout,	// time to display dialog box
41      BOOL bForceAppsClosed,	// force applications with unsaved changes flag
42      BOOL bRebootAfterShutdown 	// reboot flag
43     );
44  }
45  end;
46  
47  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