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:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Timer in a plug-in
quote:
Originally posted by raceprouk
If you're worried about a message loop, don't be. So long as you call SetTimer() in the same thread as Initialize(), Messenger's own message loop will handle dispatching the timer messages.
For that it doesn't nessecairly need to be in the Initialize() function though. You can put it in whatever procedure, as long as SetTimer() is executed somewhere within the plugin (and TimerProc() is available to the outside world)...

(eg: if you want to start the timer only when a command is parsed, you only need to put it in the ParseCommand() function).

quote:
Originally posted by Itsme-HcK
Added to this queue are also clicks with the mouse, actions, menu's, the whole crap. You have to parse those messages, so you can handle them. So, when you do that, the timer function will be called, resulting in a call to my function.
You are confusing stuff and making it harder than it is. You do not need to parse any windows messages (unless you're in your own dialog screen or are subclassing or whatever). Windows messages are almost always handled by the owners, in this case that would be Messenger itself. In case for a timer countdown, that is handled by Windows if you use a callback function.

All can be found in the MSDN Library. (Or if you only had tried out Raceprouk's example in his very first reply)

quote:
Originally posted by Itsme-HcK
But, if the user doesn't send messages to buddies for say, 15 minutes, my plug-in isn't called the whole time. So isn't my function.
It is your function, as it is a callback function which you have set as a parameter when you set the timer.

Timer messages are handled by Windows when you use a callback function, as you can read on the MSDN pages, and when they trigger they call that given function in your program back (hence callback function).

quote:
Originally posted by Itsme-HcK
Then why the hell didn't you just SAY SO? :|
Howevers, then that's it. :)
Thank y00, for as far as it did come. :P
tbh, everything was already said from the very first replies, then it got a bit vague (because you didn't say what you meant with "messages" and it is so inlogical that you meant windows messages), but after that, again the people already said all this in their replies... :S

It is clearly explained and shown on the MSDN library help page for timers, linked to by raceprouk.
quote:
An application can process WM_TIMER messages by including a WM_TIMER case statement in the window procedure or by specifying a TimerProc callback function when creating the timer. When you specify a TimerProc callback function, the default window procedure calls the callback function when it processes WM_TIMER.
and there is even a full working examples given.

This post was edited on 12-24-2005 at 09:22 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-24-2005 09:00 PM
Profile 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