Results 1 to 3 of 3

Thread: A windows question

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879

    Talking

    I'm trying to make a login in screen for windows because I don't like the current one. I want to know how to log off the current user and how to make it log back on! Any type of help concerning this subject is appreciated!!!
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  2. #2
    Guest
    To log off, use the ExitWindowsEx api function:

    Code:
    Declare Function ExitWindowsEx Lib "user32.dll" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long 
    
    EWX_FORCE = 4
    EWX_LOGOFF = 0
    
    Private Sub Command1_Click()
    Dim retval As Long  
    
    retval = ExitWindowsEx(EWX_FORCE Or EWX_FORCE, 0)
    If retval = 0 Then Debug.Print "Log off attempt failed."
    
    End Sub

    And to log back on, you'd have to still use the main log on Windows, but I suppose you could use SendKeys to do it.

  3. #3
    Guest
    SendKeys wont work. Once you log off, your app will close.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width