Solved how to create an on-screen alert on top of everything

DaveKimble

New member
Local time
9:51 AM
Messages
4
I want to monitor the status of my web server and mail server as seen by the WAN. The servers are running on machine A, with the monitoring shown on machine B on the same LAN, both running Win 7 Ult 32.

I have written a PHP script which resides on a remote server, that I invoke with a browser on B. It refreshes with a report every 5 minutes. It works OK. Occasionally it reports an error once, and then clears itself on refresh.

Now I want some kind of on-screen error alert that will be on top of whatever I am doing on B, preferably including the screensaver. I have misguidedly tried doing this with Javascript, which I now learn is banned from doing this. Some searches imply Win7 itself normally doesn't allow it either, but this can be over-ridden.

What is the best strategy ?
 

My Computer My Computer

At a glance

Windows 7 Ultimate 32-bit
OS
Windows 7 Ultimate 32-bit
SOLVED how to create an on-screen alert on top of everyt

The trick is to use Javascript to change the window's title bar on error,
and have an AutoHotKey script to watch out for a window with the title "Server Error" and bring that window to the front:

SetTitleMatchMode, 1 ; title starts with literal string
While true ; loop continuously
{
IfWinExist, Server Error ; if the window with title starts with string exists
{
; switch off screensaver here
WinActivate ; bring the window found above to the top
}
Sleep, 10000 ; repeat after a pause of 10 seconds
}

This uses 0.03% of CPU time.
This doesn't break out of the screensaver.
There are AHK scripts that do something like that, but not sufficiently well documented to use yet.
 

My Computer My Computer

At a glance

Windows 7 Ultimate 32-bit
OS
Windows 7 Ultimate 32-bit
Back
Top