|
-
Sep 27th, 2000, 05:13 PM
#1
Thread Starter
Fanatic Member
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

-
Sep 27th, 2000, 05:21 PM
#2
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.
-
Sep 27th, 2000, 06:09 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|