HOWTO: Exit Windows from a Visual Basic 4.0 ApplicationID: Q129637
|
This article shows by example how to exit Windows from a Visual Basic version 4.0 application.
When you make calls to Windows APIs from the 32-bit version of Microsoft
Visual Basic version 4.0, note that the functions being called reside in
the 32-bit DLLs of the Win32 Operating System. Therefore, it is no longer
possible to call the ExitWindows API function directly from Visual Basic
because there is no ExitWindows entry point in USER32.EXE on Win32
Operating Systems. This is a change in behaviour from previous versions of
Visual Basic.
Under Win32 Operating Systems, ExitWindows is a C++ macro in the WINUSER.H
header file that maps to the ExitWindowsEx API:
#define EWX_LOGOFF 0
#define ExitWindows(dwReserved,Code) ExitWindowsEx(EWX_LOGOFF, _
0xFFFFFFFF)
Const EWX_LogOff As Long = 0
Private Declare Function ExitWindows Lib "User32" _
Alias "ExitWindowsEx" _
(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
ExitWindows EWX_LogOff, &HFFFFFFFF
Additional query words: 4.00 terminate end quit stop vb4win vb432
Keywords :
Version : 4.0
Platform : WINDOWS
Issue type :
Last Reviewed: June 9, 1999