Solved

Display a form with I Agree or Disagree during logon process

Posted on 2004-08-22
5
132 Views
Last Modified: 2013-12-25
Hi

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
   Call TerminateAction(uFlags)
   
End Sub

Private Function TerminateAction(uTask As Long)
   
    Dim success As Long

    'assume success
    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()
    End If

    If success Then Call ExitWindowsEx(uTask, 0&)
   
End Function

Any help would be appreciated.

cheers

Paddy
0
Comment
Question by:epaitsupport
5 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 11869449
0
 

Author Comment

by:epaitsupport
ID: 12937735
I have answered this question. I used a combination of WSH and an external application called hostApp.exe.

Please close this question

cheers

0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12942321
PAQed with no points refunded (of 250)

modulo
Community Support Moderator
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question