Jump to content

System Tray Notification


Smitro
 Share

Recommended Posts

Hi,

I've created a little app that checks a website for the status of my mail. The idea is that the icon flashes when there is new mail. But for some reason, it doesn't flash until I run my mouse over it first. There is no events in my script that says to do anything on mouse over.

So now when I get new mail, it won't flash, but as soon as I run my mouse over the icon it will start flashing.

Has anyone seen anything like this before? I'll admit I didn't search because I didn't quite know what I was looking for.

Thanks in advance.

Link to comment
Share on other sites

Thanks,

The code is pretty long, so I didn't want to post it for that reason, and also for security reasons.

Something I've just found that's quite interesting...

This is the part of the script that checks the menu, and also checks for new email.

The first part that Refreshes every 5 mins was down the bottom of the while statement, and I've moved it up the top and it seems this has now fixed the problem. No idea why?

You'll see the msgbox in there, I used that for testing, as soon as I ran my mouse over the icon the msgbox would display (if the program had been already running for 3000 milliseconds). But not it does it when it's suppose to. The next weird part was that I put my msgbox above this part of the script so it was running out side of the timerdiff function, and it came up repeatedly. (like it should)

While 1
; Refresh Every 5 Mins
    If TimerDiff($refresh_timer) > 3000 Then
    ;MsgBox (0, "Mail Checking", "Mail is about to be checked")
            delete_items ($tray_folder, $number_of_folders)
            create_items ($wc_connection, $wcsession_id[0], $mail_server_address)
            $refresh_timer = TimerInit()
    EndIf


    $msg = TrayGetMsg()
    For $folder_no = 0 To $number_of_folders
        If $msg == $tray_folder[$folder_no] Then
            $oIE = _IECreate ($mail_server_address& "?Session="& $wcsession_id[0] &"&View=List&NextFolder="& $folder_names[$folder_no] &"&Frames=Yes")
        EndIf
    Next

    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $compose_button
            $oIE = _IECreate ($mail_server_address& "?Session="& $wcsession_id[0] &"&View=Compose&New=Yes")
        Case $msg = $refresh_items
            delete_items ($tray_folder, $number_of_folders)
            create_items ($wc_connection, $wcsession_id[0], $mail_server_address)
        Case $msg = $exititem
            ExitLoop
    EndSelect

WEnd

Exit

So leave it with me and I'll get back to you if I need more help.

And, Thanks for your help so far.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...