Solved

Display a form with I Agree or Disagree during logon process

Posted on 2004-08-22
5
138 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
Suggested Courses
Course of the Month4 days, 18 hours left to enroll

635 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