Solved

Need To RESTART Windows95 from VB

Posted on 1999-01-13
5
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

726 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