Solved

Display a form with I Agree or Disagree during logon process

Posted on 2004-08-22
5
135 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Run code from text file in vb 1 84
How to make an ADE file by code? 11 99
MS Access 03, TransferText, decimal places 8 85
Export Data to Different .csv Files 26 121
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 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