FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   Add to FavoritesAdd to Favorites  * Code Snippets
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    RSS Get RSS Feed  


Can a macro tell if it has been asleep?

 
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Technical / Scripting
View previous topic :: View next topic  
Author Message
Me_again
Automation Wizard


Joined: 07 Jan 2005
Posts: 1101
Location: Somewhere else on the planet
Reputation: 252.8
votes: 12

PostPosted: Thu Feb 16, 2012 9:18 pm    Post subject: Can a macro tell if it has been asleep? Reply with quote

If a compiled macro (e.g. one that collects or sends data at regular intervals) is running on a PC that goes into sleep or hibernation mode, is there any system way for it to recognize that when it starts running again? Of course it could be constantly checking the previous timestamp but I'm wondering if there is a more sophisticated solution.
Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
JRL
Automation Wizard


Joined: 10 Jan 2005
Posts: 2650
Location: Iowa
Reputation: 993.5
votes: 91

PostPosted: Fri Feb 17, 2012 12:51 am    Post subject: Reply with quote

Quote:
Of course it could be constantly checking the previous timestamp but I'm wondering if there is a more sophisticated solution.
Is this what you're NOT looking for? It works, and its not very sophisticated.



_________________
A few homemade utilities

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Me_again
Automation Wizard


Joined: 07 Jan 2005
Posts: 1101
Location: Somewhere else on the planet
Reputation: 252.8
votes: 12

PostPosted: Fri Feb 17, 2012 2:49 pm    Post subject: Reply with quote

Correct, that's not what I am looking for Smile I was wondering if there is some accessible windows flag/indicator/variable that indicates a return from sleep/hibernation.
Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
JRL
Automation Wizard


Joined: 10 Jan 2005
Posts: 2650
Location: Iowa
Reputation: 993.5
votes: 91

PostPosted: Fri Feb 17, 2012 4:11 pm    Post subject: Reply with quote

How about a test for process logonui.exe?
_________________
A few homemade utilities

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Me_again
Automation Wizard


Joined: 07 Jan 2005
Posts: 1101
Location: Somewhere else on the planet
Reputation: 252.8
votes: 12

PostPosted: Tue Feb 21, 2012 5:00 am    Post subject: Reply with quote

Hmmm, good thought, but I suspect that doesn't run unless the system is setup to require a re-login. The solution appears to be Windows Power Management Events and I found a script for another automation program that monitors those notifications.
Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic :: View next topic  
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Technical / Scripting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group