Solved

Shut Down  the computer

Posted on 2000-05-07
3
184 Views
Last Modified: 2010-05-02
Could you please tell me the command or code that can be used in VB6 to shut down the computer ??
0
Comment
Question by:Ghada
3 Comments
 
LVL 1

Accepted Solution

by:
ShaneCourtrille earned 100 total points
ID: 2785409
Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long)

Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_REBOOT = 2
Public Const EWX_SHUTDOWN = 1

Private Sub cmdButton1_Click()

Call ExitWindowsEx(EWX_SHUTDOWN, 0)
Unload Me

End Sub
 

0
 
LVL 32

Expert Comment

by:Erick37
ID: 2786209
Also see:

"PRB: ExitWindowsEx API Does Not Reboot Windows NT"

http://support.microsoft.com/support/kb/articles/Q176/6/95.asp
0
 

Author Comment

by:Ghada
ID: 2787005
Thank you ShanCoutrille's for providing me the correct answer .
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now