(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.
Private Declare Function apiExitWindowsEx Lib "user32" _
Alias "ExitWindowsEx" _
(ByVal uFlags As Long, ByVal dwReserved As Long) _
As Long
Public Const EWX_FORCE = 4
Public Const EWX_LOGOFF = 0
Public Const EWX_SHUTDOWN = 1
Public Const EWX_REBOOT = 2
Function fTerminateWin(lngExitVal As Long)
fTerminateWin = apiExitWindowsEx(lngExitVal, 0)
End Function
|