For a laptop

General discussion about PopTray. You love it? You hate it? Talk about it here.

Moderators: KY Dave, jojobear99, Rdsok

Locked
Gloops
First Timer
Posts: 2
Joined: Fri Jul 29, 2016 10:11 pm

For a laptop

Post by Gloops » Fri Jul 29, 2016 10:35 pm

Hello everybody,
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
================ ChangePower.vbs ===================

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
Last edited by Gloops on Fri Jul 29, 2016 11:07 pm, edited 1 time in total.

User avatar
Rdsok
PopTray Family
Posts: 1348
Joined: Fri Mar 19, 2004 11:36 pm
Location: Norman, Oklahoma USA
Contact:

Post by Rdsok » Fri Jul 29, 2016 11:01 pm

You may want to try PoptrayU which is an updated version of Poptray

Gloops
First Timer
Posts: 2
Joined: Fri Jul 29, 2016 10:11 pm

Post by Gloops » Fri Jul 29, 2016 11:12 pm

Thanks. Sadly I discovered about PoptrayU only once Poptray was installed and parameterized. I have no clue about what it does more or better. Did you put any screencopies of it anywhere ?

User avatar
Rdsok
PopTray Family
Posts: 1348
Joined: Fri Mar 19, 2004 11:36 pm
Location: Norman, Oklahoma USA
Contact:

Post by Rdsok » Sat Jul 30, 2016 1:46 am

I see no reason that I should post screenshots... I'm just a user that suggested you look into trying PoptrayU since it is an updated version of Poptray...

It happens to look just like Poptray... it's just been updated to support the newer versions of Windows.

If you have questions... at least look at the website for it

http://poptrayu.sourceforge.net/

Locked

Who is online

Users browsing this forum: No registered users and 2 guests