Restarting Windows 95 from a VB App. 
Author Message
 Restarting Windows 95 from a VB App.

Hi.  I have two questions for everyone out there:

Can anyone tell me how to restart/shutdown Windows 95 from a Visual Basic 5
application?

Can anyone tell me how to open control panel from a VB application?

In the past (using VB 3.0) I have used the "ExitWindows" API to exit
Windows, but using Visual Basic 5.0
I get the error "Can't find DLL entry point ExitWindows in user32".  I got
the "ExitWindows" function definition from the Microsoft supplied API
viewer.  Are there any other API's to do this?

Any suggestions are welcomed.

Shawn Lawe



Thu, 27 Jan 2000 03:00:00 GMT  
 Restarting Windows 95 from a VB App.

Quote:

>Hi.  I have two questions for everyone out there:

>Can anyone tell me how to restart/shutdown Windows 95 from a Visual Basic 5
>application?

>Can anyone tell me how to open control panel from a VB application?

>In the past (using VB 3.0) I have used the "ExitWindows" API to exit
>Windows, but using Visual Basic 5.0
>I get the error "Can't find DLL entry point ExitWindows in user32".  I got
>the "ExitWindows" function definition from the Microsoft supplied API
>viewer.  Are there any other API's to do this?

ExitWindows still works for VB3 -> Win95 with a call to the User lib.
The 32 bit API function name is different.  I'd suggest Daniel
Appleman's book "The Visual Basic Programmer's Guide to the Win32 API"

Visit my source code page at http://www.mindspring.com/~johnecarter
Visit my favorite school at http://www.mindspring.com/~addison

Get PR-Tracker -- tracks problem reports, defects, bugs
INFORMATION:  http://www.prtracker.com/info.html
DOWNLOAD:     http://www.prtracker.com/download.html



Thu, 27 Jan 2000 03:00:00 GMT  
 Restarting Windows 95 from a VB App.

To open the control panel:

x = Shell("control", 1)

I don't think ExitWindows is a valid API call in Win32. Try ExitWindowsEx.
--
Ben Baird
Microsoft SiteBuilder Network Level 2
Ben's VB5 Page, version 1.0
http://www.{*filter*}highway.com/~psy/
Now available in Netscape, IE3 & IE4 editions!


how to restart/shutdown Windows 95 from a Visual Basic 5

Quote:
>application?

>Can anyone tell me how to open control panel from a VB application?

>In the past (using VB 3.0) I have used the "ExitWindows" API to exit
>Windows, but using Visual Basic 5.0
>I get the error "Can't find DLL entry point ExitWindows in user32".  I got
>the "ExitWindows" function definition from the Microsoft supplied API
>viewer.  Are there any other API's to do this?



Fri, 28 Jan 2000 03:00:00 GMT  
 Restarting Windows 95 from a VB App.

Quote:

> tell me
> how to restart/shutdown Windows 95 from a Visual Basic 5
> >application?

> >Can anyone tell me how to open control panel from a VB application?

> >In the past (using VB 3.0) I have used the "ExitWindows" API to exit
> >Windows, but using Visual Basic 5.0
> >I get the error "Can't find DLL entry point ExitWindows in user32".
> I got
> >the "ExitWindows" function definition from the Microsoft supplied API

> >viewer.  Are there any other API's to do this?

I believe it is ExitWindowsEx, and maybe it is in Shell32.
--

Microsoft SiteBuilder Network Level 2

Ryan's VB5 Page, version 1.5
http://www1.minn.net/~jtons/
Available in Netscape, IE3 & IE4 editions

My Quote: "Never attribute to malice that
which is adequately explained by stupidity."



Fri, 28 Jan 2000 03:00:00 GMT  
 Restarting Windows 95 from a VB App.

Try this code to restart win95:

        'First, the constants
        Const EWX_LOGOFF = 0    'Log in a new user
        Const EWX_SHUTDOWN = 1  'Shutdown win95
        Const EWX_REBOOT = 2    'Shutdown, and restart
        Const EWX_FORCE = 4             'Force down, even if app{*filter*}

        'Next, the API Declare
        Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags _
                As Long, ByVal dwReserved As Long) As Long

        'Now for the Invocation...
        ExitWindowsEx EWX_REBOOT,0

Hope this helps...

Kelly

--
Kelly Murphy, MCT
Trainer
Daugherty Systems
St Louis, MO


Quote:
> Hi.  I have two questions for everyone out there:

> Can anyone tell me how to restart/shutdown Windows 95 from a Visual Basic
5
> application?

> Can anyone tell me how to open control panel from a VB application?

> In the past (using VB 3.0) I have used the "ExitWindows" API to exit
> Windows, but using Visual Basic 5.0
> I get the error "Can't find DLL entry point ExitWindows in user32".  I
got
> the "ExitWindows" function definition from the Microsoft supplied API
> viewer.  Are there any other API's to do this?

> Any suggestions are welcomed.

> Shawn Lawe



Sun, 30 Jan 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Restarting Windows 95 (And Closing all apps automatically)

2. Restart Windows 95 from VB

3. Shutdown and Restart Windows 95 and NT for VB Script

4. Restarting Windows 95???

5. Restarting Windows 3.1, 95?

6. How to Shutdown [and restart] Windows 95 / NT ?

7. Windows 95 Restart GUI

8. Windows 95 Restart GUI!

9. Restart Windows 95/98 Quickly...

10. Restarting Windows 95

11. How to RESTART WINDOWS 95 ?

12. Restarting Windows 95...

 

 
Powered by phpBB® Forum Software