Solved

Need To RESTART Windows95 from VB

Posted on 1999-01-13
5
135 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

773 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