FORMUNUZA BİR TANE BUTON EKLEYİNİZ!
AŞAGIDAKİ KODU FORMUN GENERAL KISMINA YAZINIZ!
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Boolean
Private Const EWX_SHUTDOWN = 1
Private Const EWX_FORCE = 4
Private Const EWX_REBOOT = 2
Private Const EWX_LOGOFF = 0
Private Sub Command1_Click()
tamam = ExitWindowsEx(EWX_LOGOFF, 0)
If tamam = True Then
'islem basarılı
Else
MsgBox ("Hata oluştu")
End If
End Sub