Solved

Need To RESTART Windows95 from VB

Posted on 1999-01-13
5
133 Views
Last Modified: 2012-05-04
How do I RESTART Windows95 from VB. Can't find an API call that restarts just a shutdown call?
0
Comment
Question by:rblackwell
5 Comments
 
LVL 1

Accepted Solution

by:
prozak earned 100 total points
ID: 1455952
The ExitWindowsEx function can be passed EWX_REBOOT in the uFlags parameter which will make the machine reboot after it has been shutdown.

The value of EWX_REBOOT is 2.

Hope this helps ...
0
 
LVL 4

Expert Comment

by:mcix
ID: 1455953
0
 

Expert Comment

by:masuta
ID: 1455954

I use:

    Option Explicit

    #If Win32 Then
        Private Declare Function ShutdownWindows Lib "user32" Alias _
            "ExitWindowsEx" (ByVal uFlags As Long, _
            ByVal dwReserved As Long) As Long
    #Else
        Private Declare Function ShutdownWindows Lib "user" Alias _
            "ExitWindows" (ByVal wReturnCode As Integer, _
            ByVal dwReserved As Integer) As Integer
    #End If
    Private Const EWX_LOGOFF = 0
    Private Const EWX_SHUTDOWN = 1
    Private Const EWX_REBOOT = 2
    Private Const EWX_FORCE = 4

    Private Sub Command1_Click()
        ShutdownWindows EWX_FORCE, 0
    End Sub
 

0
 

Author Comment

by:rblackwell
ID: 1455955
I am in 16 VB.
0
 
LVL 4

Expert Comment

by:mcix
ID: 1455956
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

705 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

22 Experts available now in Live!

Get 1:1 Help Now