-
I need to shell into my app first preventing Explorer's shell from loading and then log off and back in with the Explorer's shell once certain conditions have been met.
How do I code my app to log off a user without prompting the user?
It would be nice to keep it as discreet as possible.
This question is concerning Windows 95/98/ME and Visual Basic 5 or 6 Enterprise Editions.
-
Use the ExitWindowsEx API function..
Code:
Private Declare Function ExitWindowsEx Lib "user32" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As _
Long
Const EWX_FORCE = 4
Const EWX_LOGOFF = 0
Private Sub Command1_Click()
ExitWindowsEx EWX_FORCE Or EWX_LOGOFF, 0)
End Sub