Solved

Add a reminder when hitting the shutdown button

Posted on 2000-02-28
4
211 Views
Last Modified: 2010-05-02
I'm trying to set a reminder to the my staff before they shut down there Pc to do there time sheets . And I'm wanting to have it connected to the shutdown key can you help??
0
Comment
Question by:srutter
  • 2
4 Comments
 
LVL 3

Expert Comment

by:fibdev
ID: 2566499
Well,

One way you could do this is create a exe and have it run hidden when windows starts and add this to the exe's queryunload procedure.

Sub Form1_QueryUnload()

  msgbox "Don't forget your time sheet!", vbExclamation, "Friendly Reminder"

End Sub

If you would like to use this approch.  I'd be happy to create the exe for you.

I could create a standalone that does this using delphi, that way the run-time files that vb needs won't be needed.  This would simplify the installation on all the workstations and reduce file size.

0
 
LVL 14

Accepted Solution

by:
wsh2 earned 50 total points
ID: 2566507
Option Explicit

Private Sub Form_Load()
    Me.Hide
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If UnloadMode = vbAppWindows _
    Then
        Dim intReturn As Integer
        intReturn = MsgBox("Is Your Timesheet Done?", vbYesNo)
        If intReturn = vbNo _
        Then
            Cancel = 1
        End If
    End If
End Sub

0
 

Expert Comment

by:rudiger
ID: 2566803
I have created an application to fill in time sheets. The application itself is launched automatically during startup of the PC and refuses to quit if todays' information hasn't been entered.
If you like I can send you parts of the source code dealing with checking for valid information and refusing to quit.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 2566855
To be honest.. grabbing this information at Startup is a much better approach. Well done, Rudiger.. <smile>. The shutdown means is too easily defeated by just turning the computer power off.. <sigh>.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

776 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