I find poptray very nice to alert me of new mails. It cannot display accentuated characters properly, but this does not seem to be the topic.
One thing was missing : when I put my laptop on standby, it did not realize when I came out of standby, and I had to wait ten more minutes before knowing about new mails, except by putting Ctrl F12 as a shortcut to retrieve the mail (options, keyboard shortcuts) and then depressing Ctrl F12 when coming back from standby.
This works good, but I feel it is better to automatize it.
To do that if you use Windows, in your scripts folder, create both following scripts, and in the startup folder of Windows put a Windows shortcut for RunChangePower.VBS -and do not forget to ask your antivirus to authorize these scripts to execute.
I automatized the fact to send Ctrl F12 when waking up, do not forget to put it in the keyboard shortcuts of Poptray.
As you see I put a 7 seconds delay to let the network activate itself, this is to adjust to your system if needed. The displayed messages are for debug purposes, as they are displayed in a hidden window they will not bother you. You will just see Poptray display a blink 7 seconds after the wake-up, meaning that it verified the mails.
RunChangePower is executed at the beginning of the Windows session, so you see the message "Monitor the standby" at that moment, and this is all.
WshShell.Run with 0 as second parameter is to execute in a hidden window.
================ RunChangePower.VBS ================
Code: Select all
MsgBox("Monitor the standby")
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\Windows\System32\cscript.exe ChangePower.vbs", 0
Code: Select all
Set colMonitoredEvents = GetObject("winmgmts:")._
ExecNotificationQuery("SELECT * FROM Win32_PowerManagementEvent")
Do
Set strLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo strLatestEvent.EventType
WScript.Echo Time
WScript.Echo "."
If strLatestEvent.EventType = "7" then
Set WshShell = WScript.CreateObject("WScript.Shell")
WScript.Sleep 7000
WshShell.SendKeys "^{F12}"
WScript.Echo "Updating the mails count"
End If
Loop