What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [SOLVED] Notification/Log of Power State Changes?

[SOLVED] Notification/Log of Power State Changes?
Author: Message:
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. [SOLVED] Notification/Log of Power State Changes?
Edit: I solved the issue with debugging with PMMon, unfortunately my theory was incorrect, however it now provides me with proof for my warranty claim (randomly considering the AC as unplugged).

On my laptop, when I have the AC plugged in, I get a very occasional issue.

I have my power plan on "Balanced", basically the Windows 7 default, with the advanced settings modified for whatever, max brightness when plugged in, dim it slightly when unplugged.

Occasionally when AC plugged in, eventually for a quick second it will dim and get brighter, within a second.

Unfortunately the event happens so fast and so randomly I'm not going to stare at the systray to see when it shows that it is unplugged.

Is there somewhere in Windows I can log the events of when my laptop is plugged in and unplugged? Or a seperate program to run in the background?

For example:
quote:
6:33:01PM - AC Plugged in
6:33:02PM - AC Removed
6:33:03PM - AC Plugged in


Obviously if Windows thinks I unplugged my laptop when I didn't, then I'll take further action.

Thanks :cheesy:

This post was edited on 09-07-2011 at 12:26 AM by prashker.
09-05-2011 06:04 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Notification/Log of Power State Changes?
quote:
Originally posted by SonicSam
Occasionally when AC plugged in, eventually for a quick second it will dim and get brighter, within a second.
does this happen right after you have plugged the laptop in?
If so, then that is very normal. With some laptops the switch from batt. to AC power does not happen instantly. Then there is also the issue that the software (OS) must follow the hardware, and sometimes this software needs some time to initialize the new mode too, in which is sometimes resets first (to start from the default settings so to speak). Hence you can get the 'flashing' of the screen when switching power mode. So, this does not necessarily mean Windows thinks you unplugged the laptop.

PS: If your laptop is old, the plug can suffer from wear and tear and there might be a momentairly loss of contact when you wiggle the plug in or out. Or even during normal use contact can be lost. This can cause the power plan to quickly switch too of course.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-05-2011 10:50 AM
Profile PM Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Notification/Log of Power State Changes?
It is a new laptop and it does not happen right when I plug it in. I've had it happen between 1 and 2 hours in.

I have a theory why it's happening, but I want to confirm it with timestamps and stuff before I drive to the local company where I got it custom built to look at it.

This post was edited on 09-05-2011 at 04:00 PM by prashker.
09-05-2011 03:59 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Notification/Log of Power State Changes?
Never check it before myself, but maybe there are some Windows events you can check for this? eventvwr.msc
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-05-2011 04:05 PM
Profile PM Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Notification/Log of Power State Changes?
quote:
Originally posted by CookieRevised
Never check it before myself, but maybe there are some Windows events you can check for this? eventvwr.msc
Checked that earlier, the only relevant event is Power-Troubleshooter which shows what wakes the machine out of sleep. Even that doesn't really help.

This post was edited on 09-05-2011 at 04:09 PM by prashker.
09-05-2011 04:08 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Notification/Log of Power State Changes?
quote:
Originally posted by SonicSam
quote:
Originally posted by CookieRevised
Never check it before myself, but maybe there are some Windows events you can check for this? eventvwr.msc
Checked that earlier, the only relevant event is Power-Troubleshooter which shows what wakes the machine out of sleep. Even that doesn't really help.
Hmm... you sure? Because there are special event messages for this according to MSDN. Maybe they are not enabled to show up in the Event Log by default though. So, if you can't find the correct settings to enable them or something like that, maybe you can make your own event logger catching the WM_POWERBROADCAST broadcasted Windows message with the PBT_APMPOWERSTATUSCHANGE event id. And when the app recieves this message, you can check the power state with the GetSystemPowerStatus API.

This post was edited on 09-05-2011 at 04:40 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-05-2011 04:35 PM
Profile PM Find Quote Report
prashker
Veteran Member
*****


Posts: 5109
Reputation: 104
– / Male / –
Joined: Mar 2005
Status: Away
O.P. RE: Notification/Log of Power State Changes?
quote:
Originally posted by CookieRevised
Hmm... you sure?
Not really. I will look again but in the mean time searching WM_POWERBROADCAST linked me to http://exodusdev.com/products/monitor-win32-power-management-events

Seems like exactly what I want, but I will look into seeing it through Event Logger.

edit: Works perfectly and does actually EXACTLY what I want. Thanks :banana:

This post was edited on 09-06-2011 at 02:42 AM by prashker.
09-05-2011 05:01 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On