Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Display a form with I Agree or Disagree during logon process

Posted on 2004-08-22
5
Medium Priority
?
141 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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 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…

972 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