Visual Basic 6 function "windows_logoff"

Go back

Below you'll find the source for the Visual Basic 6 function windows_logoff.

Attribute VB_Name = "modWindowsLogoff"
' This function is downloaded from:
' http://www.stefanthoolen.nl/archive/vb6-functions/
' 
' You may freely distribute this file but please leave all comments, including this one, in it.
' 
' @Author Stefan Thoolen <mail@stefanthoolen.nl>

Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwReserved As Long, ByVal uReturnCode As Long) As Long

Private Const EWX_LOGOFF = 0

''
' Logs the current user off
' @return   Void
' @author   Stefan Thoolen <mail@stefanthoolen.nl>
Public Sub windows_logoff()
    ExitWindowsEx EWX_LOGOFF, 0
End Sub