?
Solved

Need To RESTART Windows95 from VB

Posted on 1999-01-13
5
Medium Priority
?
140 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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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