Solved

Display a form with I Agree or Disagree during logon process

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now