How can i detect that the system has just restarted/powered on
-
Hi.. Is it possible to detect that Windows has restated or has just been powered on? Kind regards /Kim
Not unless you already have an application up and running to detect such an event. Check out the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run registry key.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
-
Hi.. Is it possible to detect that Windows has restated or has just been powered on? Kind regards /Kim
What you mean by has just been powered Just is an inaccurat term. If you mean that you have an application violently terminating due to system shutdown and restart then your application should leave enough traces to recover itself. I suppose that Win32 will have an interface to give you the latest loggin time of the current user if that's help.
-
What you mean by has just been powered Just is an inaccurat term. If you mean that you have an application violently terminating due to system shutdown and restart then your application should leave enough traces to recover itself. I suppose that Win32 will have an interface to give you the latest loggin time of the current user if that's help.
The problem is. I have made a Win32 service application witch is set to automatic start up. For some reaches, the application unexpectedly terminates. But when I start the application with Service Manager is starts with out errors. But I have thought about this function, witch can tell me how long the system has been up an running. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/gettickcount.asp Then I will try to make a delay for about 10 seconds. when system up time is less then 10 minutes. /Kim