From: David on
I'm pretty sure I recently read about an API that would let me know
how long it has been since a laptop woke up (i.e., how long it had
been running after being in sleep or hibernate (or OFF) mode) but I
can't remember it or find anything about it. Anyone?

Thanks.
From: Kellie Fitton on
On Jun 24, 1:45 pm, David <dgi...(a)gmail.com> wrote:
> I'm pretty sure I recently read about an API that would let me know
> how long it has been since a laptop woke up (i.e., how long it had
> been running after being in sleep or hibernate (or OFF) mode) but I
> can't remember it or find anything about it. Anyone?
>
> Thanks.



Hi,

You can use the following APIs/WMI class to retrieve the number
of milliseconds that have elapsed since the system was started:

GetTickCount()

GetTickCount64()
Or,
Win32_OperatingSystem

http://msdn2.microsoft.com/en-us/library/ms724408.aspx

http://msdn2.microsoft.com/en-us/library/ms724411.aspx

http://msdn2.microsoft.com/En-US/library/aa394239.aspx

Kellie.

From: David on
On Jun 24, 5:10 pm, Kellie Fitton <KELLIEFIT...(a)yahoo.com> wrote:
> On Jun 24, 1:45 pm, David <dgi...(a)gmail.com> wrote:
>
> > I'm pretty sure I recently read about an API that would let me know
> > how long it has been since a laptop woke up (i.e., how long it had
> > been running after being in sleep or hibernate (or OFF) mode) but I
> > can't remember it or find anything about it. Anyone?
>
> > Thanks.
>
> Hi,
>
> You can use the following APIs/WMI class to retrieve the number
> of milliseconds  that have elapsed since the system was started:
>
>         GetTickCount()
>
>         GetTickCount64()
> Or,
>         Win32_OperatingSystem
>
> http://msdn2.microsoft.com/en-us/library/ms724408.aspx
>
> http://msdn2.microsoft.com/en-us/library/ms724411.aspx
>
> http://msdn2.microsoft.com/En-US/library/aa394239.aspx
>
> Kellie.

Thanks for the attempted help but this isn't what I am looking for. I
know that the above suggestion tells you how long since the system was
STARTED. I want to know how long since it last came out of hibernation
or sleep mode. (This is because I need to wait for the laptop display
to have been on for a minimum of 5 minutes before running my program.)

Perhaps someone else has this answer?

I've looked at CallNtPowerInformation but it doesn't seem to be
available outside of a device driver.
From: Volodymyr M. Shcherbyna on
Not sure that you can get this information using api. What you can do is, to
measure the time in your background application, and launch needed
applications after machine was running X minutes after hibernation. You can
track hibernation events, so you can update times.

--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"David" <dgintz(a)gmail.com> wrote in message
news:ad523b34-d3c1-46e7-a2cc-c384b7d11dd5(a)56g2000hsm.googlegroups.com...
On Jun 24, 5:10 pm, Kellie Fitton <KELLIEFIT...(a)yahoo.com> wrote:
> On Jun 24, 1:45 pm, David <dgi...(a)gmail.com> wrote:
>
> > I'm pretty sure I recently read about an API that would let me know
> > how long it has been since a laptop woke up (i.e., how long it had
> > been running after being in sleep or hibernate (or OFF) mode) but I
> > can't remember it or find anything about it. Anyone?
>
> > Thanks.
>
> Hi,
>
> You can use the following APIs/WMI class to retrieve the number
> of milliseconds that have elapsed since the system was started:
>
> GetTickCount()
>
> GetTickCount64()
> Or,
> Win32_OperatingSystem
>
> http://msdn2.microsoft.com/en-us/library/ms724408.aspx
>
> http://msdn2.microsoft.com/en-us/library/ms724411.aspx
>
> http://msdn2.microsoft.com/En-US/library/aa394239.aspx
>
> Kellie.

Thanks for the attempted help but this isn't what I am looking for. I
know that the above suggestion tells you how long since the system was
STARTED. I want to know how long since it last came out of hibernation
or sleep mode. (This is because I need to wait for the laptop display
to have been on for a minimum of 5 minutes before running my program.)

Perhaps someone else has this answer?

I've looked at CallNtPowerInformation but it doesn't seem to be
available outside of a device driver.


From: Kerem G�mr�kc� on
Hi V.

is there a "reliable" way for a user mode application, to determine
the systems wakeup from hibernation or suspend more. I never needed
that nor do i know any event or global message for usermode apps.
Is there any EventObject, WindowMessage or any other notification
method for usermode apps AND services to get something like: "Hey
Process, the operating system has come back from hibernation/suspend
mode, keep continue your work".

I mean i can use a timer and check for the time span between n-Seconds
triggerend and saved from a Timer/Event/Wait Object, compared to a
global n-seconds updated variable holding a datetime structure, then
calculating the time span. But is there something that works for Windows
2000 and Higher,...

Regards

K.

--
--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."

"Volodymyr M. Shcherbyna" <v_scherbina(a)online.mvps.org> schrieb im
Newsbeitrag news:%23Vyg2YD2IHA.5140(a)TK2MSFTNGP02.phx.gbl...
> Not sure that you can get this information using api. What you can do is,
to
> measure the time in your background application, and launch needed
> applications after machine was running X minutes after hibernation. You
can
> track hibernation events, so you can update times.
>
> --
> V.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> "David" <dgintz(a)gmail.com> wrote in message
> news:ad523b34-d3c1-46e7-a2cc-c384b7d11dd5(a)56g2000hsm.googlegroups.com...
> On Jun 24, 5:10 pm, Kellie Fitton <KELLIEFIT...(a)yahoo.com> wrote:
> > On Jun 24, 1:45 pm, David <dgi...(a)gmail.com> wrote:
> >
> > > I'm pretty sure I recently read about an API that would let me know
> > > how long it has been since a laptop woke up (i.e., how long it had
> > > been running after being in sleep or hibernate (or OFF) mode) but I
> > > can't remember it or find anything about it. Anyone?
> >
> > > Thanks.
> >
> > Hi,
> >
> > You can use the following APIs/WMI class to retrieve the number
> > of milliseconds that have elapsed since the system was started:
> >
> > GetTickCount()
> >
> > GetTickCount64()
> > Or,
> > Win32_OperatingSystem
> >
> > http://msdn2.microsoft.com/en-us/library/ms724408.aspx
> >
> > http://msdn2.microsoft.com/en-us/library/ms724411.aspx
> >
> > http://msdn2.microsoft.com/En-US/library/aa394239.aspx
> >
> > Kellie.
>
> Thanks for the attempted help but this isn't what I am looking for. I
> know that the above suggestion tells you how long since the system was
> STARTED. I want to know how long since it last came out of hibernation
> or sleep mode. (This is because I need to wait for the laptop display
> to have been on for a minimum of 5 minutes before running my program.)
>
> Perhaps someone else has this answer?
>
> I've looked at CallNtPowerInformation but it doesn't seem to be
> available outside of a device driver.
>
>