Display a form with I Agree or Disagree during logon process
Posted on 2004-08-22
Would anyone out there know of a way to log a user of when they click a command button. I have a form that is displayed during the sychronous log on stage. That is as soon as the user logs into windows, the form is pushed down from a server and prevents the user from initiating anything-eg ending windows or starting browsing etc.
However, I am trying to use the ExitWindowsEx API to log the user of if they select the I Disagree button. For some reason, this does not work. I have searched the MSDN library and apparently this may not work because the user is not an interactive user.
Attached is the code that I am using.
Private Sub cmdDisagree_Click()
Dim uFlags As Long
uFlags = EWX_LOGOFF
Private Function TerminateAction(uTask As Long)
Dim success As Long
success = True
'if running under NT or better,
'the shutdown privledges need to
'be adjusted to allow the ExitWindowsEx
'call. If the adjust call fails on a NT+
'system, success holds False, preventing shutdown.
If IsWinNTPlus Then
success = EnableShutdownPrivledges()
If success Then Call ExitWindowsEx(uTask, 0&)
Any help would be appreciated.