Search Tools Links Login

VB code with Window Network API

Posted: 2002-06-01
By: ArchiveBot
Viewed: 60

Filed Under:

Visual Basic 6

No attachments for this post


With this code your can Shutdown any Workstation connected on LAN (Local Area Network) od Windows NT/2000.
This code is very usefull for LAN applications. It will give an good idea to communicate with other worstations.

Original Author: Abid Khurshid Butt

Inputs

Just Workstation Name to Shutdown

Assumptions

User must know something about Windows API and some knowledge of Network.

Returns

Required Workstation will Shutdown

Side Effects

There no side effects for this code.

API Declarations

Private Declare Function InitiateSystemShutdown Lib "advapi32.dll" Alias "InitiateSystemShutdownA" (ByVal lpMachineName As String, ByVal lpMessage As String, ByVal dwTimeout As Long, ByVal bForceAppsClosed As Long, ByVal bRebootAfterShutdown As Long) As Long

Code

Private Sub Command1_Click()
  Dim a
  a = InitiateSystemShutdown(Trim(Text1.Text), "Hello", 0, 0, 1)
  MsgBox "Shutdown Completed"
End Sub


Comments on this post

No comments have been added for this post.

You must be logged in to make a comment.