J
Jim
Below is code written by Dave Ashish. Please read his
requirements for use of this code. The wordwrap is
terrible but I think you might get the point
Jim
(Q) How do I quit Windows from Access?
(A) Pass the function fTerminateWin one of the declared
constants.CAUTION: This function returns immediately and
the shutdown proceeds in the background. Be sure to
terminate your own application to help the shutdown
proceed smoothly. '**************** Code Begin
*******************' This code was originally written by
Dev Ashish.' It is not to be altered or distributed,'
except as part of an application.' You are free to use it
in any application,' provided the copyright notice is left
unchanged.'' Code Courtesy of' Dev Ashish'
Private Declare Function apiExitWindowsEx Lib "user32" _
Alias "ExitWindowsEx" _
(ByVal uFlags As Long,ByVal dwReserved As Long) _
As Long
Public Const EWX_FORCE = 4 'Forcibly terminates
processes
'that do not respond.
Public Const EWX_LOGOFF = 0 'Terminates processes,
then logs off.
Public Const EWX_SHUTDOWN = 1 'Powers the system off, if
possible.
Public Const EWX_REBOOT = 2 'Reboots the system.
Function fTerminateWin(lngExitVal As Long)
fTerminateWin = apiExitWindowsEx(lngExitVal, 0)
End Function'***************** Code End
*******************
requirements for use of this code. The wordwrap is
terrible but I think you might get the point
Jim
(Q) How do I quit Windows from Access?
(A) Pass the function fTerminateWin one of the declared
constants.CAUTION: This function returns immediately and
the shutdown proceeds in the background. Be sure to
terminate your own application to help the shutdown
proceed smoothly. '**************** Code Begin
*******************' This code was originally written by
Dev Ashish.' It is not to be altered or distributed,'
except as part of an application.' You are free to use it
in any application,' provided the copyright notice is left
unchanged.'' Code Courtesy of' Dev Ashish'
Private Declare Function apiExitWindowsEx Lib "user32" _
Alias "ExitWindowsEx" _
(ByVal uFlags As Long,ByVal dwReserved As Long) _
As Long
Public Const EWX_FORCE = 4 'Forcibly terminates
processes
'that do not respond.
Public Const EWX_LOGOFF = 0 'Terminates processes,
then logs off.
Public Const EWX_SHUTDOWN = 1 'Powers the system off, if
possible.
Public Const EWX_REBOOT = 2 'Reboots the system.
Function fTerminateWin(lngExitVal As Long)
fTerminateWin = apiExitWindowsEx(lngExitVal, 0)
End Function'***************** Code End
*******************