Is there a new mail

You can find the corresponding script file under Script_Examples, sub-directory of scripts.

 

'This script detects if a new mail has arrived in your mailbox.
'In order to do that, it looks forever for the small icon in the
'righthand side of the taskbar which tells there is a new mail.

'Before running that script, you need to capture the bitmap image of
'this small icon using CaptureBitmap WinTask statement.

'In the script, we have supposed that this small image is stored
'in C:\program files\wintask\scripts\newmessage.bmp.

'The script is an infinite loop, every minute, a click
'on the bitmap is made, using ClickOnBitmap statement.

'If the return code of this function is 0,
'it means that the click was successful and so the icon is present.

#Ignoreerrors=0

#ActionTimeout=1

i=1

repeat

UseWindow("EXPLORER.EXE|ToolbarWindow32|Notification Area",1,Noactivate )
ret=ClickOnBitmap("C:\Program Files\WinTask\Scripts\newmessage.bmp",left,single)
if ret=0 then

msgframe("You have a new message",1)

pause 2

removeframe(1)

endif

pause 60 secs

EndPause

until i=0