What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Timer in a plug-in

Timer in a plug-in
Author: Message:
JohnyWalker
New Member
*


Posts: 1
Joined: Dec 2005
Cool  RE: Timer in a plug-in
I created timer function without much problem using the VB.Net sample.

Declare a timer object for the class as below
Dim _Timer As System.Timers.Timer

In the Initialize function, add

Try
            _Timer = New System.Timers.Timer(30000)
            AddHandler _Timer.Elapsed, AddressOf OnTimedEvent
            _Timer.Start()
        Catch ex As Exception
            LogError(ex.Message.ToString())
        End Try

        Initialize = True



LogError just writes to a text file

Add the Timer event(callback function)


Public Sub OnTimedEvent(ByVal source As Object, ByVal e As System.Timers.ElapsedEventArgs)
        '_Timer.Stop()
        LogError("Timer Event")
        DisplayToast("Hello World", "Plus Test", "http://www.google.com", True)
    End Sub


It works great. I am getting the "Timer Event" message in the log file every 30 seconds.

Now for my problem, DisplayToast does not work. If I put it in the Initialize function, it works. Can someone please explain ?

Thanks
12-27-2005 09:32 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Timer in a plug-in - by Itsme-HcK on 12-21-2005 at 12:48 PM
RE: Timer in a plug-in - by (CyBeRDuDe) on 12-21-2005 at 01:22 PM
RE: Timer in a plug-in - by RaceProUK on 12-21-2005 at 02:07 PM
RE: Timer in a plug-in - by Itsme-HcK on 12-21-2005 at 10:03 PM
RE: Timer in a plug-in - by RaceProUK on 12-22-2005 at 11:11 AM
RE: Timer in a plug-in - by Itsme-HcK on 12-22-2005 at 01:45 PM
RE: Timer in a plug-in - by RaceProUK on 12-22-2005 at 04:12 PM
RE: Timer in a plug-in - by Itsme-HcK on 12-22-2005 at 07:50 PM
RE: Timer in a plug-in - by RaceProUK on 12-22-2005 at 08:22 PM
RE: Timer in a plug-in - by J-Thread on 12-23-2005 at 12:25 AM
RE: Timer in a plug-in - by CookieRevised on 12-23-2005 at 12:44 AM
RE: Timer in a plug-in - by Itsme-HcK on 12-23-2005 at 01:45 PM
RE: RE: Timer in a plug-in - by CookieRevised on 12-23-2005 at 03:00 PM
RE: Timer in a plug-in - by Itsme-HcK on 12-23-2005 at 03:26 PM
RE: Timer in a plug-in - by CookieRevised on 12-23-2005 at 04:16 PM
RE: Timer in a plug-in - by RaceProUK on 12-23-2005 at 06:01 PM
RE: Timer in a plug-in - by Itsme-HcK on 12-23-2005 at 06:45 PM
RE: RE: Timer in a plug-in - by CookieRevised on 12-24-2005 at 09:00 PM
RE: Timer in a plug-in - by matty on 12-23-2005 at 06:48 PM
RE: Timer in a plug-in - by (CyBeRDuDe) on 12-23-2005 at 08:09 PM
RE: Timer in a plug-in - by Itsme-HcK on 12-23-2005 at 08:23 PM
RE: Timer in a plug-in - by J-Thread on 12-23-2005 at 09:00 PM
RE: Timer in a plug-in - by ShawnZ on 12-23-2005 at 09:13 PM
RE: Timer in a plug-in - by (CyBeRDuDe) on 12-23-2005 at 10:17 PM
RE: Timer in a plug-in - by Itsme-HcK on 12-24-2005 at 08:57 AM
RE: Timer in a plug-in - by RaceProUK on 12-24-2005 at 11:26 AM
RE: Timer in a plug-in - by Itsme-HcK on 12-24-2005 at 06:03 PM
RE: Timer in a plug-in - by JohnyWalker on 12-27-2005 at 09:32 PM
RE: Timer in a plug-in - by J-Thread on 12-27-2005 at 09:45 PM
RE: Timer in a plug-in - by CookieRevised on 12-28-2005 at 06:17 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On