Solved

Add a reminder when hitting the shutdown button

Posted on 2000-02-28
4
209 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

762 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

19 Experts available now in Live!

Get 1:1 Help Now