|
-
Apr 13th, 2002, 01:13 AM
#1
Thread Starter
Hyperactive Member
please help!!!
Hi all,
In my application i want to maintain some status and store it in a file. And i want to maintain the status at the time when user shuts down the system. So can i trace when user is shuting down the system? And can i create a file (a simple .txt file) when the windows is shuting down, so that i can store the necessary status in it?
please help me,
anita.
Can't imagine life without VB
(Various Boyfriends)
-
Apr 13th, 2002, 01:15 AM
#2
In your app, make a sub main.
that sub should load form1. (not show it)
Form1 should have code in its QueryUnload to make sure that the user is not attempting to close it by himself.
If they are, just cancel the close request.
if a shutdown is posted, however, then write the date and time to a file and exit.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Apr 13th, 2002, 01:22 AM
#3
Thread Starter
Hyperactive Member
Originally posted by Lord_Rat
In your app, make a sub main.
that sub should load form1. (not show it)
Form1 should have code in its QueryUnload to make sure that the user is not attempting to close it by himself.
If they are, just cancel the close request.
if a shutdown is posted, however, then write the date and time to a file and exit.
Thanks,
But actually my application is hidden application. As it is a hiddenapplication, can control move in the "querry unload" event when the user shutting down the computer?
Anita.
Can't imagine life without VB
(Various Boyfriends)
-
Apr 13th, 2002, 01:29 AM
#4
The form itself will be hidden, but yes, it still receives a query unload.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Apr 13th, 2002, 01:30 AM
#5
HI,
u can get it easily the shutdown time...place ur application in startup ( application should have no interface...i.e invisible.)
If u shut down then automatically the form unload event 'll occur.In the unload event of form retrive the current time and placed in a text file.
I think it 'll help to solve ur problem
-
Apr 13th, 2002, 06:59 AM
#6
PowerPoster
Ive used sree's method before and it works well.
you can also log periods of inactivity (with computer on) by comparing cursor positions at a timer event.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|